Relative imports in Python
In case you want to do a relative import in Python, first add the path to sys.path like this:
import sys
sys.path.append('<your path>')
You can now import any module from that path directly
Note: Relative import is not recommended as per PEP8 standards
Written by Kiran Gangadharan
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#