user3557327
user3557327

Reputation: 1169

Is there a standard way to get the user config directory in python

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

Answers (1)

Phaneendra
Phaneendra

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

Related Questions