Re: optparse question (python 2.6)

2013-09-02 Thread Peter Otten
Andy Kannberg wrote: > I tried with the example Peter gave me, and it works. But only when the > options are boolean. At least, that is my conclusion with experimenting. > I'll elaborate: > > The code to create 'mutually exclusive options': > > option_names = [ "l", "o" , "s" ] > toggled_optio

Re: optparse question (python 2.6)

2013-09-02 Thread Andy Kannberg
Hi all, I tried with the example Peter gave me, and it works. But only when the options are boolean. At least, that is my conclusion with experimenting. I'll elaborate: The code to create 'mutually exclusive options': option_names = [ "l", "o" , "s" ] toggled_options = [name for name in option

Re: optparse question (python 2.6)

2013-08-26 Thread Peter Otten
Andy Kannberg wrote: > Hi python-guru's, > > I am new to Python, coming from a long history of Unix/linux shell > programming. > I am creating a Python script (In Python 2.6) which should be able to > read command line options and arguments. > So far, I figured out how to do that with optparse.