Problem accessing config files within a Python egg

前端 未结 2 827
滥情空心
滥情空心 2021-02-14 03:08

I have a Python project that has the following structure:

package1
  class.py
  class2.py
  ...
package2
  otherClass.py
  otherClass2.py
  ...
config
  dev_sett         


        
2条回答
  •  情话喂你
    2021-02-14 03:57

    See Setuptools' discussion of accessing pacakged data files at runtime. You have to get at your configuration file a different way if you want the script to work inside an egg. Also, for that to work, you may need to make your config directory a Python package by tossing in an empty __init__.py file.

提交回复
热议问题