richard kappler wrote: > Thanks for the reply Martin, and in this instance I cannot post the actual > code (company rules). What I can do is say that with the xslt variable > defined within the formatter method, everything works, but when I pull it > out and put it in the upper level of the class, it gives me a traceback > that says the global variable xslt is not defined. Does that help?
You need to qualify the class attribute with self to access it from within a method: >>> class MyClass: ... xslt = "/path/to/file" ... def some_method(self): ... print(self.xslt) ... >>> m = MyClass() >>> m.some_method() /path/to/file _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
