Within my class of categories
, I have several functions that reference to a variable. For them to access the variable I had to make the variable global. It worked, it's fine, when there only is one object within the class. When it had two, the results blew. Other objects also had access to the global variable and changed its value. Is there a way I could set-up a global variable for the class methods but are unique to every class instances?
EDIT:
Thanks guys, I am now enlightened with using the __init__
method. There was no need to use global variables.