[Distutils] Re: Variable substitution

Stefan Seefeld seefeld at sympatico.ca
Tue Oct 7 17:29:35 EDT 2003

Andrey Lebedev wrote:

 > Is anybody thought about such approach?

I used two approaches:

Modify the executable at install time,
inserting the prefix that was used via
'python setup.py install --prefix=...'

The problem with this approach is that it
fails to take into account for example wininst,
where the real path is only known after
executing the windows installer.

The other solution I used is to assume
a common prefix for executables and datafiles
(i.e. <prefix>/bin or <prefix>/scripts for the
executable, <prefix>/share for the data files),
and then computing the datadir from sys.argv[0].

The problem with this is that not all
installations use a common prefix for executables
and data files.

Hope this helps,

More information about the Distutils-SIG mailing list