Reputation: 1169
I can get the home with os.path.expanduser("~")
but is there a standard way to get the config directory? Like ~/.config
in most unices, or the value of $XDG_CONFIG_HOME
in (recent?) Linux and C:\Users\<user>\AppData\Local\Roaming
in Windows), etc
Upvotes: 28
Views: 10445
Reputation: 461
You can take advantage of python third party library appdirs platformdirs
which does all the heavy lifting for you across multiple platforms ( Windows, Linux & Mac )
Upvotes: 29