A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/349697.html below:

Finding where to store application data portably

Finding where to store application data portably Finding where to store application data portablyRon Adam rrr at ronadam.com
Thu Sep 22 14:18:54 EDT 2005
Tony Houghton wrote:

>  > This works on Win XP.  Not sure if it will work on Linux.
>  >
>  > import os
>  >
>  > parent = os.path.split(os.path.abspath(os.sys.argv[0]))[0]
>  > file = parent + os.sep + '.bombz'
> 
> Ooh, no, I don't want saved data to go in the installation directory. In
> general that practice encourages people to run with Admin access, and
> it's about time Windows users were discouraged from that.

Yes, it occurred to me you didn't want to do that after I posted.

Looks like maybe the correct place would be as you suggested, but maybe 
doing it this way would be better.

import os
user = os.path.join( os.environ["USERPROFILE"],
                      'Application Data',
                      'Bombz' )


Cheers,
Ron






More information about the Python-list mailing list

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