path to data files

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Thu Aug 19 23:15:56 EDT 2010


In message <mailman.2300.1282213519.1673.python-list at python.org>, Daniel 
Fetchinson wrote:

> If a python module requires a data file to run how would I reference
> this data file in the source in a way that does not depend on whether
> the module is installed system-wide, installed in $HOME/.local or is
> just placed in a directory from where the interpreter is fired up?

You may want to look at the XDG Base Directory Specification 
<http://standards.freedesktop.org/basedir-spec/latest/>. There is a python-
xdg module which implements this.



More information about the Python-list mailing list