Getting input the scanf way

alex23 wuwei23 at gmail.com
Wed Jul 1 23:47:46 EDT 2009


On Jul 1, 6:33 pm, "Mr.SpOOn" <mr.spoo... at gmail.com> wrote:
> I need to do some kind of interactive command line program.
>
> I mean: I run the program, it asks me for input, I type something and
> then I get the output or other questions.
> I'm not sure what is the right way to achieve this.

While the simplest way would be raw_input & print, as suggested,
there's also the cmd[1] module in the stdlib, which is what the
standard CPython interpreter uses, I believe.

[1]: http://docs.python.org/library/cmd.html



More information about the Python-list mailing list