How do I store desktop application data in a cross platform way for python?

Well, I hate to have been the one to answer my own question, but no one else seems to know. I'm leaving the answer for posterity.

Well, I hate to have been the one to answer my own question, but no one else seems to know. I'm leaving the answer for posterity. APPNAME = "MyApp" import sys from os import path, environ if sys.

Platform == 'darwin': from AppKit import NSSearchPathForDirectoriesInDomains # http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html#//apple_ref/c/func/NSSearchPathForDirectoriesInDomains # NSApplicationSupportDirectory = 14 # NSUserDomainMask = 1 # True for expanding the tilde into a fully qualified path appdata = path. Join(NSSearchPathForDirectoriesInDomains(14, 1, True)0, APPNAME) elif sys. Platform == 'win32': appdata = path.

Join(environ'APPDATA', APPNAME) else: appdata = path. Expanduser(path. Join("~", "." + APPNAME)).

2 have to looked into pypi.python. Org/pypi/appdirs/1.2.0 – tkone Mar 10 at 17:02.

Well, for Windows APPDATA (environmental variable) points to a user's "Application Data" folder. Not sure about OSX, though. The correct way, in my opinion, is to do it on a per-platform basis.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions