> user_log_dir ( appname, appauthor ) '/Users/trentm/Library/Logs/SuperApp' > user_cache_dir ( appname, appauthor ) '/Users/trentm/Library/Caches/SuperApp' > site_data_dir ( appname, appauthor ) '/Library/Application Support/SuperApp' On macOS: > from platformdirs import * > appname = "SuperApp" > appauthor = "Acme" > user_data_dir ( appname, appauthor ) '/Users/trentm/Library/Application Support/SuperApp' Look for “OPINION” inĭocumentation and code for when an opinion is being applied. Is slightly opinionated on the directory names used. Platformdirs will help you choose an appropriate: This kind of thing is what the platformdirs package is for. On Linux (and other Unices), according to the XDG Basedir Spec, it should be: ~/.local/share/ platformdirs to the rescue Or possibly: C:\Documents and Settings\\Application Data\\įor roaming profiles but that is another story. If on Windows (at least English Win) that should be: C:\Documents and Settings\\Application Data\Local Settings\\ May by plenty of nuances in figuring out the right location.įor example, if running on macOS, you should use: ~/Library/Application Support/ When writing desktop application, finding the right location to store user dataĪnd configuration varies per platform.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |