Python imports: Sample Project + Explanations

Answering a question on using imports in Python pograms
Python
Author

Thadryan

Published

September 30, 2018

Salutations!

A friend of mine recently asked me for some pointers on Python import statements, and I thought I would share what I came up with. The import command allows us to use code from other libraries, directories, source files, etc. It’s a fundamental tools that’s been around since way before Python (think “#include <stdio.h>”, and further). The structure is easier to demonstrate if we break from our go-to Jupyter format, so have a look at the project here. Have a look at the code in utils.py, OtherUtils/utils\_one\_dir_down.py, and then read the mains!