Created
April 6, 2012 14:52
-
-
Save jrabbit/2320541 to your computer and use it in GitHub Desktop.
Make an app folder/ get app folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def directory(app_name): | |
"""Construct app_dir from os name""" | |
home = os.path.expanduser('~') | |
if platform.system() == 'Linux': | |
app_dir = os.path.join(home, '.' + app_name) | |
elif platform.system() == 'Darwin': | |
app_dir = os.path.join(home, 'Library', 'Application Support', | |
app_name) | |
elif platform.system() == 'Windows': | |
app_dir = os.path.join(os.environ['appdata'], app_name) | |
else: | |
app_dir = os.path.join(home, '.' + app_name) | |
if not os.path.isdir(app_dir): | |
os.mkdir(app_dir) | |
return app_dir |
Its for config/saves. Use resource location or w/e from distribute so that
you can install.
…On Fri, Apr 6, 2012 at 11:55 PM, Alec Goebel < ***@***.*** > wrote:
iiiiinteresting. I like it in theory. This would be more for save files
and config files. The kind of loader I was planning was going to be
loading relative paths based on **main**'s root directory.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2320541
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
iiiiinteresting. I like it in theory. This would be more for save files and config files. The kind of loader I was planning was going to be loading relative paths based on main's root directory.