diff options
author | Georg Brandl <georg@python.org> | 2011-03-06 10:56:18 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-03-06 10:56:18 +0100 |
commit | 3640e18d90098a37d8cb841ec145a9c9e0d54f5b (patch) | |
tree | 9a4578b504567d9706e84b3454e215579cd03b4d /Doc/tutorial/inputoutput.rst | |
parent | da2271939a3a6d7922390750c09f4029da2f0b6f (diff) | |
download | cpython-git-3640e18d90098a37d8cb841ec145a9c9e0d54f5b.tar.gz |
#11405: do not reference the string module again for its deprecated functions, only for Template class.
Diffstat (limited to 'Doc/tutorial/inputoutput.rst')
-rw-r--r-- | Doc/tutorial/inputoutput.rst | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst index 84e83b5d7d..c570e27002 100644 --- a/Doc/tutorial/inputoutput.rst +++ b/Doc/tutorial/inputoutput.rst @@ -19,18 +19,16 @@ the :func:`print` function. (A third way is using the :meth:`write` method of file objects; the standard output file can be referenced as ``sys.stdout``. See the Library Reference for more information on this.) -.. index:: module: string - Often you'll want more control over the formatting of your output than simply printing space-separated values. There are two ways to format your output; the first way is to do all the string handling yourself; using string slicing and concatenation operations you can create any layout you can imagine. The -standard module :mod:`string` contains some useful operations for padding +string type has some methods that perform useful operations for padding strings to a given column width; these will be discussed shortly. The second way is to use the :meth:`str.format` method. -The :mod:`string` module contains a class Template which offers yet another way -to substitute values into strings. +The :mod:`string` module contains a :class:`~string.Template` class which offers +yet another way to substitute values into strings. One question remains, of course: how do you convert values to strings? Luckily, Python has ways to convert any value to a string: pass it to the :func:`repr` |