Here is the directory structure:
parent_dir/ foo_dir/ foo.py bar_dir/ bar.py
How do I import bar.py into foo.py?
You can use the sys and os modules for generalized imports. In foo.py start with the lines
sys
os
foo.py
import sys import os sys.path.append(os.path.abspath('../bar_dir')) import bar