]> granicus.if.org Git - python/commitdiff
Document input() function.
authorGeorg Brandl <georg@python.org>
Wed, 12 Sep 2007 21:29:27 +0000 (21:29 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 12 Sep 2007 21:29:27 +0000 (21:29 +0000)
Doc/library/functions.rst

index 601aa3627d5877b23962bf38cab88e98bf102077..5f315d87698713f1dcbb92c4ab9424dd4471b23c 100644 (file)
@@ -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