I'd like a code snippet that gets the proper directory for app data (config files, etc) on all platforms (Win/Mac/Linux at least). For example: %APPDATA%/ on Windows.
To open the AppData folder on Windows 10, 8 & 7: Open File Explorer/Windows Explorer. Type %AppData% into the address bar and hit enter. Navigate to the required folder (Roaming or Local)
AppData is a hidden folder located in C:\Users\<username>\AppData. The AppData folder contains custom settings and other information needed by applications.
Roaming folder contains data that can move with the user profile from a computer to a computer. Local folder contains data that cannot move with your user profile. LocalLow folder includes low-level access data, eg. temporary files of your browser when running in a protected mode.
If you don't mind using the appdirs module, it should solve your problem. (cost = you either need to install the module or include it directly in your Python application.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With