Learning Python
Xavier Morel
xavier.morel at masklinn.net
Sun Feb 5 11:18:38 EST 2006
Byte wrote:
> x = input(raw_input("Please enter your name: "))
> if x==myself: print 'OK'
>
> It kinda works - I can get to the please enter your name bit but then
> it simply reprints your input as output. Someone please HELP!
>
-->
C:\>python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> help(input)
Help on built-in function input in module __builtin__:
input(...)
input([prompt]) -> value
Equivalent to eval(raw_input(prompt)).
>>> help(raw_input)
Help on built-in function raw_input in module __builtin__:
raw_input(...)
raw_input([prompt]) -> string
Read a string from standard input. The trailing newline is stripped.
If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise
EOFError.
On Unix, GNU readline is used if enabled. The prompt string, if given,
is printed without a trailing newline before reading.
<--
Where the hell did you get the idea of stacking input on a raw_input in
the first place?
More information about the Python-list
mailing list