I always used Python for single-file scripts, and now I'm working on my first “complex” project, so I have no experience with packages in Python (3.x).
I know this is a frequently asked question, but I am missing something to successfully organize the import of modules in my project, which should be used as a library.
Assuming the following project tree:
myProject/
- subpackage1/
- __init__.py
- other1.py
- subpackage2/
- __init__.py
- other2.py
- __init__.py
- foo.py
- bar.py
What is the correct way to import modules from each other? In particular:
- import
foofrombar - import
foofromother1 - import
other1fromother2 - import
foo(which is a library) from another directory at design time (are virtual environments the right choice?)
Thank!
EDIT: ( ), , , , . , , , from myProject.subpackage1.other1 import something. ( , Java), , , - . virtualenv , ?