R: [Tutor] setting variables off the command line

Marcel Preda pm@dis.ro
Thu, 20 Jul 2000 11:40:27 +0200


> 
>     how do I collect variables from users from within a python program
> i.e
> 
>     print  what is  your name  ?
>     read (name)
>     print hello name !
> 
> thankyou
>   Peter

The `raw_input' function...

>>> name=raw_input('What is your name?\n')
What is your name?
Larry
>>> print "Hi " +name +"\n"
Hi Larry

PM