User Input?

Steven Adams adams_s at lab.eng.usyd.edu.au
Sun Jun 4 08:08:10 EDT 2000


use raw_input

>>> def get_SPAM_n_EGGS():
                    spam = raw_input('Spam? ')
                    eggs = raw_input('and Eggs? ')
                    print spam, eggs


>>> get_SPAM_n_EGGS()
Spam? loads
and Eggs? yessiree
loads yessiree
>>>

hope that helps

Steven

Michael Morrison <borlak at home.com> wrote in message
news:cnj_4.3811$r7.919327 at news1.rdc2.tx.home.com...
> My friend was talking about a programming asignment and I was telling him
> about python, so we decided to make programs in our different languages
(his
> being QBasic :P) ...
>
> Anyway, it dealt with user input, and from only having read Learning
Python,
> I didn't know how to do it (and still don't).
> Is there an easy way to do user input in python?  I found a non-standard
> module, but it looked too complicated (not something I'd expect from the
> ease-of-use I've had so far).
>
> Example: python blah.py
> Name? (type in name)
> Address? (type in address)
> etc....
>
> Any help would be appreciated, thanks!
>
>
>
>





More information about the Python-list mailing list