好吧,我不想成为回答我自己问题的人,但似乎没人知道。我留下后人的答案。
APPNAME = "MyApp"import sysfrom os import path, environif 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))
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)