Re: Best practice for config files?

Chuck Rhode <[email protected]>
Newsgroups gmane.comp.python.general
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 22 May 2025 14:59:28 -0500
"Michael F. Stemper" <[email protected]> wrote:

> Is requiring the program to be executed in the directory containing
> the configuration file considered acceptable practice?

Freedesktop.org proposes a specification for where such things ought
to be located:

+ https://specifications.freedesktop.org/basedir-spec/latest/

Here's how I do it:

> def get_xdg_config_home():
> 
>     """The configuration directory.
> 
>     Normally $HOME/.config. 
> 
>     """
>     
>     result = pathlib.Path.home() / ".config"
>     return result

- -- 
.. Be Seeing You,
.. Chuck Rhode, Sheboygan, WI, USA
.. Weather:  https://LacusVeris.com/Wx
.. 47° — Wind NNW at 12 mph. Sky clear.
-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQT+MY/5I/LMPSswTbVg2/xipKOWUgUCaDB5oAAKCRBg2/xipKOW
Ukg/AJ9cWxtykecg31HvVrCz+GhWPOn+gQCePacKiSXFlRdkEeyrzksobcbTCFw=
=OzzD
-----END PGP SIGNATURE-----
-- 
https://mail.python.org/mailman3//lists/python-list.python.org
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.