[Python-3000-checkins] r58131 - python/branches/py3k/Doc/library/functions.rst

georg.brandl python-3000-checkins at python.org
Wed Sep 12 23:29:27 CEST 2007


Author: georg.brandl
Date: Wed Sep 12 23:29:27 2007
New Revision: 58131

Modified:
   python/branches/py3k/Doc/library/functions.rst
Log:
Document input() function.


Modified: python/branches/py3k/Doc/library/functions.rst
==============================================================================
--- python/branches/py3k/Doc/library/functions.rst	(original)
+++ python/branches/py3k/Doc/library/functions.rst	Wed Sep 12 23:29:27 2007
@@ -524,6 +524,22 @@
    (Implementation note: this is the address of the object.)
 
 
+.. function:: input([prompt])
+
+   If the *prompt* argument is present, it is written to standard output without
+   a trailing newline.  The function then reads a line from input, converts it
+   to a string (stripping a trailing newline), and returns that.  When EOF is
+   read, :exc:`EOFError` is raised.  Example::
+
+      >>> s = raw_input('--> ')
+      --> Monty Python's Flying Circus
+      >>> s
+      "Monty Python's Flying Circus"
+
+   If the :mod:`readline` module was loaded, then :func:`raw_input` will use it
+   to provide elaborate line editing and history features.
+
+
 .. function:: int([x[, radix]])
 
    Convert a string or number to an integer.  If the argument is a string, it


More information about the Python-3000-checkins mailing list