On Jun 12, 2012 9:56 AM, "Andreas Perstinger" <andiper...@gmail.com> wrote: > > On Tue, 12 Jun 2012 09:07:13 +0100 > Bod Soutar <bod...@googlemail.com> wrote: > > > C:\>python cheatsheet.py --list > > done > > here? > > Traceback (most recent call last): > > File "cheatsheet.py", line 167, in <module> > > main() > > File "cheatsheet.py", line 165, in main > > ca.parseArgs() > > File "cheatsheet.py", line 39, in parseArgs > > self.argList() > > File "cheatsheet.py", line 96, in argList > > handle = cf.load() > > NameError: global name 'cf' is not defined > > You define "cf" only inside your "main" function, so the "cliArgs" > class doesn't know about it. So either make "cf" global (bad) or change > your "cliArgs" class so that it takes a "cheatFile" object as an > argument and you would call it like: > > ca = cliArgs(cf) > > HTH, Andreas >
Thanks, that makes sense. I'll give it a go. Cheers, Bodsda _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor