[Python-checkins] r74260 - python/trunk/Doc/tutorial/inputoutput.rst
georg.brandl
python-checkins at python.org
Wed Jul 29 19:15:20 CEST 2009
Author: georg.brandl
Date: Wed Jul 29 19:15:20 2009
New Revision: 74260
Log:
Fix a few markup glitches.
Modified:
python/trunk/Doc/tutorial/inputoutput.rst
Modified: python/trunk/Doc/tutorial/inputoutput.rst
==============================================================================
--- python/trunk/Doc/tutorial/inputoutput.rst (original)
+++ python/trunk/Doc/tutorial/inputoutput.rst Wed Jul 29 19:15:20 2009
@@ -127,16 +127,17 @@
We are the knights who say "Ni!"
The brackets and characters within them (called format fields) are replaced with
-the objects passed into the format method. The number in the brackets refers to
-the position of the object passed into the format method. ::
+the objects passed into the :meth:`~str.format` method. The number in the
+brackets refers to the position of the object passed into the
+:meth:`~str.format` method. ::
>>> print '{0} and {1}'.format('spam', 'eggs')
spam and eggs
>>> print '{1} and {0}'.format('spam', 'eggs')
eggs and spam
-If keyword arguments are used in the format method, their values are referred to
-by using the name of the argument. ::
+If keyword arguments are used in the :meth:`~str.format` method, their values
+are referred to by using the name of the argument. ::
>>> print 'This {food} is {adjective}.'.format(
... food='spam', adjective='absolutely horrible')
@@ -157,7 +158,7 @@
The value of PI is approximately 3.142.
Passing an integer after the ``':'`` will cause that field to be a minimum
-number of characters wide. This is useful for making tables pretty.::
+number of characters wide. This is useful for making tables pretty. ::
>>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678}
>>> for name, phone in table.items():
@@ -178,7 +179,7 @@
Jack: 4098; Sjoerd: 4127; Dcab: 8637678
This could also be done by passing the table as keyword arguments with the '**'
-notation.::
+notation. ::
>>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}
>>> print 'Jack: {Jack:d}; Sjoerd: {Sjoerd:d}; Dcab: {Dcab:d}'.format(**table)
@@ -356,9 +357,9 @@
>>> f.closed
True
-File objects have some additional methods, such as :meth:`isatty` and
-:meth:`truncate` which are less frequently used; consult the Library Reference
-for a complete guide to file objects.
+File objects have some additional methods, such as :meth:`~file.isatty` and
+:meth:`~file.truncate` which are less frequently used; consult the Library
+Reference for a complete guide to file objects.
.. _tut-pickle:
More information about the Python-checkins
mailing list