I am looking to import a set of modules from a subdirectory into a single main module in the parent directory:
Project/
main.py
subdirectory/
__init__.py
timer.py
example.py
I can ask for any of the individual .py files like so:
from subdirectory import timer.py
But, if I run the following command,
from subdirectory import *
and I try to use a module within that subdirectory, I get the following error:
File "My:\Path\Here\...", line 33, in main
t = timer.timer()
NameError: name 'timer' is not defined
I want to be able to import all of the files in one batch, as I am importing a couple of modules. I already added a blank init.py file to the subdirectory. Is there anything that I am missing?