Absolute vs Relative Imports in Python: Summary
Congratulations! You’re now up to speed on how absolute and relative imports work in Python. You’ve learned the best practices for writing
import statements, and you know the difference between absolute and relative imports.
With your new skills, you can confidently import packages and modules from the Python standard library, third party packages, and your own local packages. Remember that you should generally opt for absolute imports over relative ones, unless the path is complex and would make the statement too long.
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
Become a Member to join the conversation.