Issue with classes
2012-06-12 08:07:13 GMT
I am having some difficulty calling a class method from a different class.
When I run the attached script like this "python cheatsheet.py --list"
C:\>python cheatsheet.py --list
Traceback (most recent call last):
File "cheatsheet.py", line 167, in <module>
File "cheatsheet.py", line 165, in main
File "cheatsheet.py", line 39, in parseArgs
File "cheatsheet.py", line 96, in argList
handle = cf.load()
NameError: global name 'cf' is not defined
So the traceback points to the issue being on line 96, specifically the call to cf.load(). cf.load() (line 147) is part of the cheatFile class (line 125), and is instantiated with cf = cheatFile() (line 161)
I confess I don't know anything about classes really so I'm probably doing something stupid, but can anyone point me in the right direction?
_______________________________________________ Tutor maillist - Tutor <at> python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor