I am trying to distribute a python package with a file other than python. The file is in mypackge / config.yml, and I also added it to manifest.in (recursive-include mypackage * .yml). When I run the python setup.py installation, it is apparently added to the egg, but I do not know how to access the file inside the code. open(os.path.join('mypackage', 'config.yml'))will stop working as soon as I exit the directory where setup.py ...
Is there a way to securely access the file inside the egg, for example, the Java method getResourceAsStream?
source
share