Re: Problem with getting an option value

2007-04-11 Thread Bruno Desthuilliers
Nanjundi a écrit : > On Apr 10, 10:23 am, "Lucas Malor" <[EMAIL PROTECTED]> wrote: > >> Thank you. Do you know also if I can do a similar operation with >> functions? I want to select with a string a certain get() function >> of ConfigParser: >> >> if type == "int" : funcname = "getint" elif t

Re: Problem with getting an option value

2007-04-10 Thread Nanjundi
On Apr 10, 10:23 am, "Lucas Malor" <[EMAIL PROTECTED]> wrote: > Peter Otten wrote: > > Lucas Malor wrote: > > >> The problem is options is an instance, so options."delete", for example, > >> is wrong; I should pass options.delete . How can I do? > > > Use getattr(): > > Thank you. Do you know also

Re: Problem with getting an option value

2007-04-10 Thread Gabriel Genellina
En Tue, 10 Apr 2007 11:23:37 -0300, Lucas Malor <[EMAIL PROTECTED]> escribió: > Peter Otten wrote: >> Lucas Malor wrote: >>> >>> The problem is options is an instance, so options."delete", for >>> example, >>> is wrong; I should pass options.delete . How can I do? >> >> Use getattr(): > > Than

Re: Problem with getting an option value

2007-04-10 Thread Larry Bates
Lucas Malor wrote: > Peter Otten wrote: >> Lucas Malor wrote: >>> The problem is options is an instance, so options."delete", for example, >>> is wrong; I should pass options.delete . How can I do? >> Use getattr(): > > Thank you. Do you know also if I can do a similar operation with functions? I

Re: Problem with getting an option value

2007-04-10 Thread Bruno Desthuilliers
Lucas Malor a écrit : > Peter Otten wrote: >> Lucas Malor wrote: >>> The problem is options is an instance, so options."delete", for >>> example, is wrong; I should pass options.delete . How can I do? >> Use getattr(): > > Thank you. Do you know also if I can do a similar operation with > function

Re: Problem with getting an option value

2007-04-10 Thread Lucas Malor
Peter Otten wrote: > Lucas Malor wrote: >> >> The problem is options is an instance, so options."delete", for example, >> is wrong; I should pass options.delete . How can I do? > > Use getattr(): Thank you. Do you know also if I can do a similar operation with functions? I want to select with a

Re: [optparse] Problem with getting an option value

2007-04-06 Thread Mel Wilson
Peter Otten wrote: > Lucas Malor wrote: > >> Hello all. I'm trying to do a little script. Simply I want to make a list >> of all options with them default values. If the option is not specified in >> the command line, the script must try to read it in a config.ini file. If >> it's not present also

Re: [optparse] Problem with getting an option value

2007-04-06 Thread Peter Otten
Lucas Malor wrote: > Hello all. I'm trying to do a little script. Simply I want to make a list > of all options with them default values. If the option is not specified in > the command line, the script must try to read it in a config.ini file. If > it's not present also there, it must set the def

[optparse] Problem with getting an option value

2007-04-06 Thread Lucas Malor
Hello all. I'm trying to do a little script. Simply I want to make a list of all options with them default values. If the option is not specified in the command line, the script must try to read it in a config.ini file. If it's not present also there, it must set the default value. The problem