Re: [Tutor] Testing for commandline args

2005-05-17 Thread Cedric BRINER
> Also, I hear that optparse is much better than getopt. this is a true pleasure to work with optparse. It was included in python2.3 and was primarly called python-optik Ced. -- Cedric BRINER ___ Tutor maillist - Tutor@python.org http://mail.py

Re: [Tutor] Testing for commandline args

2005-05-13 Thread Danny Yoo
> > If I have arguments, the "different stuff" happens beautifully, thank > you very much. If I don't have arguments I get this: > > if sys.argv[1]: > IndexError: list index out of range] > > So I'm doing something wrong. I looked at getopt, but that seemed to be > doing what I was already doing,

Re: [Tutor] Testing for commandline args

2005-05-13 Thread Max Noel
On May 14, 2005, at 01:30, William O'Higgins wrote: > if sys.argv[1]: > do stuff > else: > do different stuff > > If I have arguments, the "different stuff" happens beautifully, thank > you very much. If I don't have arguments I get this: > > if sys.argv[1]: > IndexError: list index out