> Windows and Mac OS X have dedicated directories for application specific > libraries. That is ~/Library on Mac and Application Data on Windows. In fact, I had to write code for this, and had to read the specs for each. Here's the code (I've substituted Python for UpLib): if sys.platform == 'darwin': listdir = os.path.expanduser(os.path.join("~", "Library", "Application Support", "org.python")) elif sys.platform == 'win32': if os.environ.has_key('APPDATA'): listdir = os.path.join(os.environ['APPDATA'], 'Python') elif os.environ.has_key('USERPROFILE'): listdir = os.path.join(os.environ['USERPROFILE'], 'Application Data', 'Python') elif os.environ.has_key('HOMEDIR') and os.environ.has_key('HOMEPATH'): listdir = os.path.join(os.environ['HOMEDIR'], os.environ['HOMEPATH'], 'Python') else: listdir = os.path.join(os.path.expanduser("~"), 'Python') else: # pretty much has to be unix listdir = os.path.expanduser(os.path.join("~", ".python"))
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4