How Imports Work in Python

And a bit about packages

Aniruddha Karajgi
Better Programming
Published in
12 min readJun 28, 2021

--

Image of flowers
Photo by Blanca Paloma Sánchez on Unsplash

The Python import system is pretty straightforward... to a point. Importing code present in the same directory you’re working in is very different from importing between multiple files present in multiple directories. Through this post, I analyse some scenarios commonly encountered when working with imports, hopefully making it easier for you to create your own packages.

--

--