3 ms·
No, your impression was right. Reading this blog post made me realize how little I know about the python import system (and I use python daily), and at the same
by trulyme 5y ago
No, your impression was right. Reading this blog post made me realize how little I know about the python import system (and I use python daily), and at the same time how little I want to learn it. It is completely unintuitive and probably one of the worst aspects of otherwise beautiful and useful language. Fortunately, sys.path hack works reliably - one can just add that one line and imports work as expected.
- mixmastamyk 5y agoThere's only about three things to learn at first. If you know how a path and relative path work from the shell, there is only one thing: touch __init__.py. These are on the import doc page and beginners tutorial. https://docs.python.org/3/tutorial/modules.html#packages https://docs.python.org/3/tutorial/modules.html#packages