3

I want my application to write a simple application configuration file per user. However, I'd like to place the configuration file under the most sensible path.

On Linux, configuration files can reside under ~ or ~/.config.
On Windows, configuration files can reside under %USERPROFILE% (typically C:\Users\user), or %APPDATA% (typically C:\Users\user\AppData), or %LOCALAPPDATA% (typically C:\Users\user\AppData\Local).

Is there a cross-platform Python module that picks the best application configuration directory for me?
This application configuration file must be readable and writeable by the user-run application.

JamesThomasMoon
  • 6,169
  • 7
  • 37
  • 63
  • Similar, but not the same as [What is the correct cross-platform way to get the home directory in Python?](https://stackoverflow.com/questions/4028904/what-is-the-correct-cross-platform-way-to-get-the-home-directory-in-python), [What is the best method for setting up a config file in Python](https://stackoverflow.com/questions/49643793/what-is-the-best-method-for-setting-up-a-config-file-in-python), [What's the best practice using a settings file in Python?](https://stackoverflow.com/questions/5055042/whats-the-best-practice-using-a-settings-file-in-python). – JamesThomasMoon Jan 09 '22 at 07:31
  • 1
    https://stackoverflow.com/questions/26722607/cross-platform-method-to-obtain-the-users-configuration-home-directory-in-pytho – ɹɐʎɯɐʞ Apr 04 '22 at 05:45

0 Answers0