[Python-checkins] r78616 - python/branches/py3k/Doc/library/argparse.rst

benjamin.peterson python-checkins at python.org
Wed Mar 3 03:09:18 CET 2010


Author: benjamin.peterson
Date: Wed Mar  3 03:09:18 2010
New Revision: 78616

Log:
convert to print function

Modified:
   python/branches/py3k/Doc/library/argparse.rst

Modified: python/branches/py3k/Doc/library/argparse.rst
==============================================================================
--- python/branches/py3k/Doc/library/argparse.rst	(original)
+++ python/branches/py3k/Doc/library/argparse.rst	Wed Mar  3 03:09:18 2010
@@ -30,7 +30,7 @@
                       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 @@
 
    >>> 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-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()


More information about the Python-checkins mailing list