Best practice for config files?

"Michael F. Stemper via Python-list" <[email protected]>
Newsgroups gmane.comp.python.general
Organization A noiseless patient Spider
Message-ID <[email protected]>
I recently wrote a program to do some record-keeping for me. I found
myself hard-coding a bunch of different values into it. This didn't
seem right, so I made my first use of configparser.ConfigParser().
Created the configuration file and everything is working fine.

However, I wrote it based on the assumption that the program is
running in the directory where the config file is stored, and has
a specific name. I started having some second thoughts here.

I thought about putting the location of the configuration file in
the configuration file, but that seemed like a non-starter.[1]

Should I specify the location of the config file with a command-line
option, or is requiring the program to be executed in the directory
containing the configuration file considered acceptable practice?



[1] See Tegan Jovanka in _Castrovalva_ for more on this idea.
-- 
Michael F. Stemper
If it isn't running programs and it isn't fusing atoms, it's just bending space.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.