Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Getting input the scanf way

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


mr.spoon21 at gmail

Jul 1, 2009, 1:33 AM

Post #1 of 4 (318 views)
Permalink
Getting input the scanf way

Hi,
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.

Thanks,
Carlo
--
http://mail.python.org/mailman/listinfo/python-list


python at mrabarnett

Jul 1, 2009, 5:26 PM

Post #2 of 4 (286 views)
Permalink
Re: Getting input the scanf way [In reply to]

Mr.SpOOn wrote:
> Hi,
> 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.
>
Use raw_input() and print.
--
http://mail.python.org/mailman/listinfo/python-list


wuwei23 at gmail

Jul 1, 2009, 8:47 PM

Post #3 of 4 (283 views)
Permalink
Re: Getting input the scanf way [In reply to]

On Jul 1, 6:33 pm, "Mr.SpOOn" <mr.spoo...@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
--
http://mail.python.org/mailman/listinfo/python-list


mr.spoon21 at gmail

Jul 3, 2009, 12:23 PM

Post #4 of 4 (272 views)
Permalink
Re: Getting input the scanf way [In reply to]

Thanks, I think raw_input() will work just fine for my needs.
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.