Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 339
user3557327 Avatar asked Aug 06 '15 21:08

user3557327


1 Answers

You can take advantage of python third party library appdirs which does all the heavy lifting for you across multiple platforms ( Windows, Linux & Mac )

like image 146
Phaneendra Avatar answered Nov 10 '22 09:11

Phaneendra