Making code run in both source tree and installation path

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Thu Jul 2 01:53:09 EDT 2009


In message <mailman.2428.1246465065.8015.python-list at python.org>, Robert 
Kern wrote:

> On 2009-07-01 01:04, Carl Banks wrote:
>>
>> The most common way I've seen people work around this issue is to
>> throw their data files into the package directories.  Yuck.
> 
> Huh. I always found that to be a more elegant solution than hardcoding the
> data location into the program at install-time.

Think in terms of a portable OS, written to run on multiple architectures. 
Read-only data is architecture-dependent, that's why it pays to separate it 
from the code.

Otherwise you end up with a system that needs a reinstall every time the 
hardware changes.





More information about the Python-list mailing list