Newbie Question...

Tim Peters tim.one at home.com
Sun Feb 25 14:07:02 EST 2001


[Michael Ellwood]
> I've been looking, but I can't find any reference in the Python
> docs of how to get python to prompt the user to input a string -
> ...

>>> response = raw_input("Please enter a string: ")
Please enter a string: OK, this is a string.
>>> type(response)
<type 'string'>
>>> print response
OK, this is a string.
>>>

raw_input() and its more-dangerous friend input() are described in the
Library Reference Manual, in the section on builtin functions.





More information about the Python-list mailing list