summaryrefslogtreecommitdiffstats
path: root/Doc/library/functions.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-09-12 21:29:27 (GMT)
committerGeorg Brandl <georg@python.org>2007-09-12 21:29:27 (GMT)
commitc09029889ab39120bdaf568ae873a2c40ac16925 (patch)
tree5707ce5f95a156b68fdb8a43fbcf574c4c7b45a5 /Doc/library/functions.rst
parent7dd803a4d43f8c2a7b3aa69c8f934f8a497afc60 (diff)
downloadcpython-c09029889ab39120bdaf568ae873a2c40ac16925.zip
cpython-c09029889ab39120bdaf568ae873a2c40ac16925.tar.gz
cpython-c09029889ab39120bdaf568ae873a2c40ac16925.tar.bz2
Document input() function.
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r--Doc/library/functions.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 601aa36..5f315d8 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -524,6 +524,22 @@ available. They are listed here in alphabetical order.
(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