Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #197489
| Path | csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | "Michael F. Stemper" <michael.stemper@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Best practice for config files? |
| Date | Thu, 22 May 2025 14:59:28 -0500 |
| Organization | A noiseless patient Spider |
| Lines | 22 |
| Message-ID | <100nvn0$3kq1t$1@dont-email.me> (permalink) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Thu, 22 May 2025 21:59:30 +0200 (CEST) |
| Injection-Info | dont-email.me; posting-host="1d095e90b5eeccf22efc8a9d3f8cf050"; logging-data="3827773"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+RbCCphzDq6IfIcpVCpsWjY/UpS8Keto0=" |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 |
| Cancel-Lock | sha1:cIGh+D0u83EWUjhOvFjq4+yGvkI= |
| Content-Language | en-US |
| Xref | csiph.com comp.lang.python:197489 |
Show key headers only | View raw
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.
Back to comp.lang.python | Previous | Next — Next in thread | Find similar
Best practice for config files? "Michael F. Stemper" <michael.stemper@gmail.com> - 2025-05-22 14:59 -0500
Re: Best practice for config files? ram@zedat.fu-berlin.de (Stefan Ram) - 2025-05-22 20:27 +0000
Re: Best practice for config files? ram@zedat.fu-berlin.de (Stefan Ram) - 2025-05-22 20:33 +0000
Re: Best practice for config files? ram@zedat.fu-berlin.de (Stefan Ram) - 2025-05-23 19:18 +0000
Re: Best practice for config files? (Posting On Python-List Prohibited) Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-05-23 22:22 +0000
Re: Best practice for config files? (Posting On Python-List Prohibited) rbowman <bowman@montana.com> - 2025-05-24 03:00 +0000
Re: Best practice for config files? "Michael F. Stemper" <michael.stemper@gmail.com> - 2025-05-24 10:05 -0500
Re: Best practice for config files? Paul Rubin <no.email@nospam.invalid> - 2025-05-22 17:37 -0700
Re: Best practice for config files? (Posting On Python-List Prohibited) Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-05-23 01:20 +0000
Re: Best practice for config files? Chuck Rhode <CRhode@LacusVeris.com> - 2025-05-23 08:35 -0500
Re: Best practice for config files? Jason H <jason_hindle@yahoo.com> - 2025-05-24 11:46 +0000
csiph-web