Use Relative Imports
Use relative imports in python to ease code module maintenance.
Here is a normal import:
from my.awesome.package import foo
And the relative equivalent from the package my
:
from .awesome.package import foo
Written by Ron Elliott
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Related Tags
#python
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#