Command line input
Jorgen Grahn
grahn+nntp at snipabacken.se
Mon Mar 31 18:51:19 EDT 2008
On 31 Mar 2008 20:13:05 GMT, Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:
> On Mon, 31 Mar 2008 12:39:54 -0700, hexusnexus wrote:
>
>> How do I receive input from the command line in Python?
>
> Direct way `sys.argv`, comfortable way `optparse`.
I have a feeling he doesn't mean command-line arguments to the
program, but typing on the keyboard after the program has started.
If that is the case:
Direct way `sys.stdin`, many other fancy ways.
/Jorgen
--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.se> R'lyeh wgah'nagl fhtagn!
More information about the Python-list
mailing list