module setting file location

Michael Mell mike at nthwave.net
Wed Feb 20 15:16:58 EST 2002


I've created a module which needs to read a certain file to initialize
several user-specific variables. Currently the module only looks for the
settings file in the same directory as itself:

 settings = os.path.split(__file__)[0] # get the module's parent
directory
 settings = os.path.join(settings, "SettingsFile.txt")

I want the installation to be as easy as possible for end users while
conforming to good Python practices. In the current arrangement, the
settings file will often be located in the Python/Lib directory.

Where should the settings file be located?

thx
--
mike at nthwave.net
llemekim         YahooIM
415.455.8812     voice
419.735.1167     fax






More information about the Python-list mailing list