One way is to make each of your myapp_service*_start.py
files add myapp/
directory to sys.path
.
For example, drop a file called import_me.py
into myapp_service1/
with code that appends the "one up" directory (relative to importing file) to sys.path
:
import os
import sys
import inspect
this_dir = os.path.dirname(inspect.getfile(inspect.currentframe()))
src_dir = os.path.join(this_dir, '..')
sys.path.insert(0, src_dir)
Then, in your myapp_service1_start.py
you can do something like:
import import_me
from common import myapp_common1
from common import myapp_common2
Of course, be sure to make common
directory a Python package by dropping a (possibly empty) __init__.py
file into it.