Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

relative import in python

import sys
sys.path.append("")		# fixes import issues

from your_file import your_class
# OR
from your_dir.your_file import your_class

# also, make sure there is an empty __init__.py file in each directory
 
PREVIOUS NEXT
Tagged: #relative #import #python
ADD COMMENT
Topic
Name
9+6 =