Alexander Daychilde (Gmail) wrote:
class TestObject:
def __init__(self):
# options and arguments from commandline-->OptionParser
self.opt = ""
here, self.opt is initialized as a string...
self.args = []
def load_cfg(self):
# read+parse commandlnie
Le Thu, 9 Apr 2009 08:47:59 -0700,
"Alexander Daychilde (Gmail)" s'exprima ainsi:
> The error I get when running the above code:
>
> Traceback (most recent call last):
>
> File "listinclass.py", line 34, in
>
> test.load_ini()
>
> File "listinclass.py", line 17, in load_ini
>
>
With the small font size and lots of blank lines I find this hard to read!
When I look at the optparse documentation I guess you want
print self.opt.inifile
Alexander Daychilde (Gmail) wrote:
I feel like I’m missing something simple, but I have now spent hours
googling for an answer. I think
I feel like I'm missing something simple, but I have now spent hours
googling for an answer. I think I must not be searching for the right terms,
or else this is something I'm not supposed to be doing - but it seems
straightforward to me.
Here's my test code (condensed from the actual much long