Re: Best practice for config files?

Liste des GroupesRevenir à cl python 
Sujet : Re: Best practice for config files?
De : michael.stemper (at) *nospam* gmail.com (Michael F. Stemper)
Groupes : comp.lang.python
Date : 24. May 2025, 16:05:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <100sn6t$oj7m$3@dont-email.me>
References : 1 2
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 22/05/2025 15.27, Stefan Ram wrote:
"Michael F. Stemper" <michael.stemper@gmail.com> wrote or quoted:
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?
    It was me who digged out this "platformdirs" "user_config_dir"
   API using a source code search on my harddisk without any help.
   But then I asked my buddy, the chatbot, to explain how to
   use it, which I include here, followed by some more words
   of my own at the end. Chatbot:
[massive snip]

   On Linux:
 ~/.config/YourAppName
[another one]
Wow, if that's the best practice, I'll settle for second-best!
Somebody who wished to remain anonymous contacted me via email and
suggested that I could have my cake and eat it, too. I am going
ahead with having a default location for the config file, as well
as a command-line option to specify a different file. Blindingly
obvious!
And the default will not be in the directory in which the program
is being run. Your post reminded me of the existence of $HOME/.config
which is obviously the right place for it.
Thanks for all of the suggestions.
--
Michael F. Stemper
I refuse to believe that a corporation is a person until Texas executes one.

Date Sujet#  Auteur
22 May 25 * Best practice for config files?11Michael F. Stemper
22 May 25 +* Re: Best practice for config files?6Stefan Ram
22 May 25 i+- Re: Best practice for config files?1Stefan Ram
23 May 25 i+* Re: Best practice for config files?3Stefan Ram
23 May 25 ii`* Re: Best practice for config files? (Posting On Python-List Prohibited)2Lawrence D'Oliveiro
24 May 25 ii `- Re: Best practice for config files? (Posting On Python-List Prohibited)1rbowman
24 May 25 i`- Re: Best practice for config files?1Michael F. Stemper
23 May 25 +* Re: Best practice for config files?2Paul Rubin
23 May 25 i`- Re: Best practice for config files? (Posting On Python-List Prohibited)1Lawrence D'Oliveiro
23 May 25 +- Re: Best practice for config files?1Chuck Rhode
24 May 25 `- Re: Best practice for config files?1Jason H

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal