[Tutor] interactive script

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Jan 31 21:32:26 CET 2014


On 31/01/2014 15:38, Gabriele Brambilla wrote:

Please don't top post on this mailing list.

> to simplify the question:
> does a command like cin in C++ or scanf in C exist??
>
> thanks
>
> Gabriele
>
>
> 2014-01-31 Gabriele Brambilla <gb.gabrielebrambilla at gmail.com
> <mailto:gb.gabrielebrambilla at gmail.com>>:
>
>     Hi,
>     I'm very new to Python (just 5 days!)
>     is there a possibility to write an interactive script?
>     in the sense that:
>
>     - you run your script and it do some things that you don't want to
>     type everytime you run the program
>     - but at a certain step I want that it ask me question like "which
>     column of this matrix do you want to use?" and I want to give to it
>     the answer, and after it that it do what I answered.
>     - I don't want to use argv method.
>
>     thank you
>
>     Gabriele
>
>     p.s: I'm using Anaconda
>

Use raw_input() with Python 2 or input() with Python 3.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list