i made a python toolbox with various tools to interact with a Portal. i set it up using a global variable that would hold the portal info so i dont have to get it for every tool. This created issues as other tools not in this toolbox would raise errors that this global varibale is not defined.
i defined the variable the Toolbox class __init__, i am confused how the __init__ method of the Toolbox class is being called when that toolbox is not open
That aside i know its not great practice to use global variables and i cant control the above issues so i went down the road of trying to pass the now non-global variable between the tools in the Toolbox by setting it as an attribute of Toolbox in the __init__ method and then inheriting the Toolbox class in each Tool Class
This ran in to the problem
"TypeError: Cannot create a consistent method resolution
order (MRO) for bases object, Toolbox"
so i can use the inheritance method as both of these classes must be already inherited into some class when it runs.
How can i pass variables either from the Toolbox class to each tool or even just between tools?