On 14/10/05, Marc Buehler <[EMAIL PROTECTED]> wrote:
> hi.
>
> i want to pass an argument (a number) to a python
> script when running it:
> > python script.py <number>

Have a look at sys.argv!

#### testargs.py ####
import sys
print sys.argv
####

C:\temp>python testargv.py 1 2 foo
['testargv.py', '1', '2', 'foo']

If you want to do anything vaguely complicated, have a look at the
getopt and optparse modules.

--
John.
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to