diff Doc/tutorial/errors.rst @ 42642:9fc21c8babb9

No need to define raw_input(), input() does the same.
author Georg Brandl <georg@python.org>
date Fri, 17 Aug 2007 05:54:09 +0000
parents 9e1529bf0442
children 95d6fe2e8e0e
line wrap: on
line diff
--- a/Doc/tutorial/errors.rst	Fri Aug 17 04:19:37 2007 +0000
+++ b/Doc/tutorial/errors.rst	Fri Aug 17 05:54:09 2007 +0000
@@ -85,15 +85,9 @@
 whatever the operating system supports); note that a user-generated interruption
 is signalled by raising the :exc:`KeyboardInterrupt` exception. ::
 
-   >>> def raw_input(prompt):
-   ...     import sys
-   ...     sys.stdout.write(prompt)
-   ...     sys.stdout.flush()
-   ...     return sys.stdin.readline()
-   ... 
    >>> while True:
    ...     try:
-   ...         x = int(raw_input("Please enter a number: "))
+   ...         x = int(input("Please enter a number: "))
    ...         break
    ...     except ValueError:
    ...         print "Oops!  That was no valid number.  Try again..."