Using __init__.py

Kryptxy kryptxy at protonmail.com
Wed Sep 6 05:30:59 EDT 2017


I am working on a (cross-platform) project. On linux system, the imprts work fine, but in windows I get imort error (I have no idea why. I tried searching everywhere, but couldn't get it to work).
Anyways, the issue seem to be resolved by adding project directory to sys.path().

I wanted to know that can I use __init__.py file for adding a project directory to sys.path (sys.path.insert(0, directory))?


More information about the Python-list mailing list