summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-03-03 02:09:18 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-03-03 02:09:18 (GMT)
commitb2deb118f5e7e7988bfebdc207900d7230de73e6 (patch)
tree1c2943a20403f9c7c5e5dc695ee79676a9cf411f /Doc
parent98047eb806227f11212f6a42c242030a51964e30 (diff)
downloadcpython-b2deb118f5e7e7988bfebdc207900d7230de73e6.zip
cpython-b2deb118f5e7e7988bfebdc207900d7230de73e6.tar.gz
cpython-b2deb118f5e7e7988bfebdc207900d7230de73e6.tar.bz2
convert to print function
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/argparse.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index f3962e0..edb28e8 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -30,7 +30,7 @@ produces either the sum or the max::
help='sum the integers (default: find the max)')
args = parser.parse_args()
- print args.accumulate(args.integers)
+ print(args.accumulate(args.integers))
Assuming the Python code above is saved into a file called ``prog.py``, it can
be run at the command line and provides useful help messages::
@@ -698,7 +698,7 @@ An example of a custom action::
>>> class FooAction(argparse.Action):
... def __call__(self, parser, namespace, values, option_string=None):
- ... print '%r %r %r' % (namespace, values, option_string)
+ ... print('%r %r %r' % (namespace, values, option_string))
... setattr(namespace, self.dest, values)
...
>>> parser = argparse.ArgumentParser()
@@ -1413,10 +1413,10 @@ Sub-commands
>>> # sub-command functions
>>> def foo(args):
- ... print args.x * args.y
+ ... print(args.x * args.y)
...
>>> def bar(args):
- ... print '((%s))' % args.z
+ ... print('((%s))' % args.z)
...
>>> # create the top-level parser
>>> parser = argparse.ArgumentParser()