S
Sam Peterson
I've been googling for a while now and cannot find a good way to deal
with this.
I have a slightly messy python program I wrote that I've historically
just run from the extracted source folder. I have pictures and sound
files in this folder that this program uses. I've always just used
the relative path names of these files in my program.
Lately, I had the idea of cleaning up my program and packaging it with
distutils, but I've been stuck on a good way to deal with these
resource files. The package_data keyword seems to be the way to go,
but how can I locate and open my files once they've been moved? In
other words, what should I do about changing the relative path names?
I need something that could work from both the extracted source
folder, AND when the program gets installed via the python setup.py
install command.
with this.
I have a slightly messy python program I wrote that I've historically
just run from the extracted source folder. I have pictures and sound
files in this folder that this program uses. I've always just used
the relative path names of these files in my program.
Lately, I had the idea of cleaning up my program and packaging it with
distutils, but I've been stuck on a good way to deal with these
resource files. The package_data keyword seems to be the way to go,
but how can I locate and open my files once they've been moved? In
other words, what should I do about changing the relative path names?
I need something that could work from both the extracted source
folder, AND when the program gets installed via the python setup.py
install command.