where to put application-specific data files?

Brian Blais bblais at bryant.edu
Thu Oct 11 11:03:46 EDT 2007


Hello,

I am developing an application that needs some data files, but I am  
not sure what the best way to package and access them.  For instance,  
I have module like:

mymodule/
    __init__.py
    run.py

    data/
      file1.dat
      file2.dat


In run.py, I can do something like:

    fname='data/file1.dat'

which will work if I run it *in* the mymodule folder.  Once I install  
it, or want to do:

import mymodule
mymodule.run.this()

it won't know where the data/ folder is.  Is there a recommended way  
of locating application-specific data files?  If I want to save user- 
configuration files, is there a recommended procedure/place for these?



		thanks,


			Brian Blais


-- 
Brian Blais
bblais at bryant.edu
http://web.bryant.edu/~bblais



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071011/9665d4b3/attachment.html>


More information about the Python-list mailing list