Accessing application data portably

Tom E H tom-2006 at jaguarpaw.get-rid-of-this-bit.co.uk
Wed Aug 23 17:40:20 EDT 2006


Larry Bates wrote:
> Tom E H wrote:
>> My Python application includes some data files that need to be accessed
>> by modules I distribute with it.
>> 
>> Where can I put them, and how should I arrange my code, so that it works
>> across platforms?
>>
> I almost always send along an application.ini file and put the location
> of where my data is to be stored in that file instead of imbedding (or
> worse, hard-coding) it in the application program itself.

> Something like:
> 
> [init]
> debug=0
> quiet=0
> datafilepath=/usr/lib/myprogram/datafile

Well that's great, but how do you access the ini file portably?

Tom



More information about the Python-list mailing list