Programming‎ > ‎Python‎ > ‎

import



Here is the way to do nested import

proj/
   start.py
   __init__.py
   tests/
       test.py 
       __init__.py

test.py
   import os, sys
   sys.path.insert(0, os.path.abspath("."))
   import start

cd proj

python tests/test.py

Works great

Reference:

Comments