Interesting list Validity (True/False)

Carsten Haese carsten at uniqsys.com
Fri May 11 17:15:01 EDT 2007


On Fri, 2007-05-11 at 14:07 -0700, nufuhsus at gmail.com wrote:
> OK. Then how would you differenciate between a call with an option
> versus one without (e.g. help.py -o (where arg == ['-o']) Vs. help.py
> (where arg == []))?

if arg:
  print "With options"
else:
  print "Without options"

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list