Accessing 'Package Data'
Diez B. Roggisch
deets at nospam.web.de
Tue Oct 9 10:58:13 CEST 2007
Stefan Arentz wrote:
> At http://docs.python.org/dist/node12.html it is described how to add
> package data to a module. This was pretty easy to do, but now how do I
> access this data from my module? Is there an API to load a 'package
> resource' ala Java's classloader?
You can always use os.path + the __file__-attribute of the containing
And there is the 3rd-party pkg_resources, part of setuptools:
More information about the Python-list