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

I can get home from os.path.expanduser("~")

, but is there a standard way to get the config directory? For example ~/.config

on most systems or meaning $XDG_CONFIG_HOME

in (recent?) Linux and C:\Users\<user>\AppData\Local\Roaming

Windows) etc.

+3


source to share


1 answer


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



+6


source







All Articles