I currently have a directory structure like so:
- App
-- Model
-- Controller
-- View
-- main.py
I want to import main.py into a class into a controller file for testing purposes. How can I achieve this?
I currently have a directory structure like so:
- App
-- Model
-- Controller
-- View
-- main.py
I want to import main.py into a class into a controller file for testing purposes. How can I achieve this?
Add an empty __init__.py
file in the directory App
to turn that directory into a package.
Then, provided the /path/to/App
is visible in the sys.path
of your python environment, you should be able to:
from App import main