Help: low level user input

Kyle E Kyle_E2006 at hotmail.com
Sun Oct 26 15:10:34 EST 2003


> Kyle E wrote:
>
> > Ok, I have a little tiny problem, a beginner problem, that I am
> > overlooking. I am writing a Information Gathering Program, that takes
user
> > input from scripted questions and prints them in a handy list in the
end.
> > As of now, when one of my questions is asked, the only possible way to
> > enter text is to
> > type (  "John"  ) minus the parenthesis.  You do need the qoutation
marks
> > though. I just want to be able to type (  John  ) without the unneeded
> > quotation marks. I know someone has the answer, sorry for the
> > inexperienced question, but it's ticking me off.

Peter Wrote:
>
> Use raw_input() instead of input() to get the string as typed by the user.
> input() evaluates the user input what is definitely not what you want in
> your little program, e. g:
>
> >>> Peter = "John"
> >>> input()
> Peter
> 'John'
>
> or most likely:
>
> >>> input("First name ")
> First name John
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "<string>", line 0, in ?
> NameError: name 'John' is not defined
> >>>
>
> HTH,
> Peter
>

Kyle Wrote:

I forgot about using raw_input, now I can finish writing my program, Thanks
a lot Peter






More information about the Python-list mailing list