[Distutils] install-data and finding the installed files

Tessa Lau tlau-distutils@ofb.net
Fri Dec 20 13:09:01 2002


I'm distributing a Python application which has to install and use
a data file.  In my setup.py I include the following option:

setup (name = "MyProg",
	...
	data_files = [('config', ['data.rc'])],
	scripts = ['doit'],
	...
)

When I run "setup.py install --prefix=/foo/bar", setup will copy my
data file to /foo/bar/config/data.rc.

However my Python program needs to know how to find that file.  How
does the "doit" script find out the installation directory so that it
can compute the absolute path to the data.rc file?

Thanks,
--Tessa