I can name my script as follows:
python D:\myscript.py 60
And in the script, I can do:
arg = sys.argv[1] foo(arg)
But how can I check if an argument was entered in a command line call? I need to do something like this:
if isset(sys.argv[1]): foo(sys.argv[1]) else: print "You must set argument!!!"
python
Richard Knop Nov 15 '10 at 20:24 2010-11-15 20:24
source share