On Mon, 24 Sep 2007 01:04:58 -0700, cjt22 wrote: > for i in range(len(args)): > if args[i] == "-no": > Initialise.init(0) > Process.processCon(file2,1) > Output.print() > > if args[i] == "-not": > Initialise.init(1) > Process1.process(stepStore, firstSteps) > Output.print1()
That ``for`` loop is an anti-pattern in Python. If you want to iterate over the elements of `args` the just do it directly instead of using an index: for arg in args: if arg == '-no': # ... If you need the element *and* an index: for i, arg in enumarate(args): # ... Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list