Managing resources in a Python project

前端 未结 4 1576
星月不相逢
星月不相逢 2020-12-12 20:36

I have a Python project in which I am using many non-code files. Currently these are all images, but I might use other kinds of files in the future. What would be a good sch

4条回答
  •  星月不相逢
    2020-12-12 21:10

    @ pycon2009, there was a presentation on distutils and setuptools. You can find all of the videos here

    Eggs and Buildout Deployment in Python - Part 1

    Eggs and Buildout Deployment in Python - Part 2

    Eggs and Buildout Deployment in Python - Part 3

    In these videos, they describe how to include static resources in your package. I believe its in part 2.

    With setuptools, you can define dependancies, this would allow you to have 2 packages that use resources from 3rd package.

    Setuptools also gives you a standard way of accessing these resources and allows you to use relative paths inside of your packages, which eliminates the need to worry about where your packages are installed.

提交回复
热议问题