Currently, I have a parser with multiple classes that work together.
For Instance: TreeParser creates multiple Product and Reactant modules which in turn create multiple Element classes. The TreeParser is called by a render method within the same module, which is called from the importer.
Finally, if the package has dependencies (such as re and another another module within the same folder), where is the best place to require those modules? Within the __init__.py
file or within the module itself?
EDIT:
When importing a part of a module that calls another def within the module, how do you call that def if it isn't imported?
lib/toolset.py => def add(){ toolset.show("I'm Add"); } def show(text){print text};
if that file is called from main.py => import lib.toolset
then, the show method wouldn't be loaded, or main.py => from lib.toolset import show
wouldn't work.
Can an import toolset
be put at the top of toolset.py
?