Hi,
i have a class:

class LogHandler(ContentHandler):
    # a reference to a file open by some other function/class
    outputFile;


    def endElement(self, name):
         doSomething(self, "GroupResultList", self.text, outputFile)


First, I get an error saying 'NameError: global name 'outputFile' is
not defined' , how can I declare outputFile as a 'file reference'?

Second , how can I set this file reference after I create the object
'LogHandler'?

How can I do that?
f = open('dummyFile.txt');
curHandler = LogHandler()
curHandler.file = f

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to