Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #60552

Re: Getting the Appdata Directory with Python and PEP?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'heavily': 0.04; 'one?': 0.05; 'subject:Python': 0.06; 'subject:Getting': 0.07; 'subject:PEP': 0.07; 'lawrence': 0.09; 'pension': 0.09; 'prevents': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'tismer': 0.09; 'unified': 0.09; 'windows,': 0.09; 'api': 0.11; 'python': 0.11; "'user'": 0.16; 'help?': 0.16; 'linux).': 0.16; 'locations.': 0.16; 'newlines': 0.16; 'none.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'utc,': 0.16; 'appropriate': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'module': 0.19; '>>>': 0.22; 'programming': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'directory.': 0.24; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; "skip:' 10": 0.31; 'apparently': 0.31; "year's": 0.31; 'run': 0.32; 'url:python': 0.33; 'maybe': 0.34; 'subject:the': 0.34; 'could': 0.34; 'subject:with': 0.35; "can't": 0.35; 'tool': 0.35; 'but': 0.35; 'thanks': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'error.': 0.37; 'application': 0.37; 'christian': 0.38; 'skip:o 20': 0.38; 'massive': 0.38; 'to:addr :python-list': 0.38; 'stock': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'invest': 0.60; 'up,': 0.60; 'world.': 0.61; 'back': 0.62; 'kind': 0.63; 'myself': 0.63; 'today': 0.64; 'different': 0.65; '26,': 0.68; 'home': 0.69; 'stated': 0.69; 'saw': 0.77; 'you:': 0.81; 'received:89': 0.85; 'do:': 0.91; 'funds,': 0.93; '2013': 0.98
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Getting the Appdata Directory with Python and PEP?
Date Tue, 26 Nov 2013 23:21:28 +0000
References <50402350-c9cb-47be-b513-ad2fb7170187@googlegroups.com> <27870dae-87ff-4435-a2ff-a42f95c21d48@googlegroups.com> <5294f942$0$16012$e4fe514c@news.xs4all.nl> <2b6c4be1-e23f-488b-b64d-191d625dee46@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-89-240-172-101.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.1
In-Reply-To <2b6c4be1-e23f-488b-b64d-191d625dee46@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3263.1385508104.18130.python-list@python.org> (permalink)
Lines 71
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1385508104 news.xs4all.nl 15946 [2001:888:2000:d::a6]:52064
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:60552

Show key headers only | View raw


On 26/11/2013 22:49, Eamonn Rea wrote:
> On Tuesday, November 26, 2013 7:40:50 PM UTC, Irmen de Jong wrote:
>> On 26-11-2013 19:09, Eamonn Rea wrote:
>>
>>> Thanks for the help on PEP, but I can't find a way to get the application support (appdata on Windows, no idea on Linux). If I do:
>>
>>>
>>
>>> print os.environ['HOME']
>>
>>>
>>
>>> I get: '/Users/eamonn', as that is my home directory. But when I do:
>>
>>>
>>
>>> print os.environ['APPDATA']
>>
>>>
>>
>>> I get an error. But when I do:
>>
>>>
>>
>>> print os.getenv('APPDATA')
>>
>>>
>>
>>> I get: None.
>>
>>>
>>
>>> Apparently os.getenv() works on Windows, but I can't see a way to get this on Mac. If I could get the names of this for different OS's I could just check the OS and run the appropriate code.
>>
>>>
>>
>>> Any help?
>>
>>>
>>
>>
>>
>>
>>
>> Maybe this module is of some use to you:
>>
>> https://pypi.python.org/pypi/appdirs
>>
>>
>>
>> It provides a unified Python API to the various OS specific 'user' directory locations.
>>
>>
>>
>> Irmen
>
> I saw this, but I wanted to do it myself as I stated in the OP :)
>

Do you realise that stock markets wordwide have plumetted again today 
because of the massive surplus of newlines from this year's harvests? 
The only way to get the markets back up, and with it my pension funds, 
is to invest very heavily in a tool that somehow prevents this surplus. 
  Would you be kind enough to get one?

-- 
Python is the second best programming language in the world.
But the best has yet to be invented.  Christian Tismer

Mark Lawrence

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Getting the Appdata Directory with Python and PEP? Eamonn Rea <eamonnrea@gmail.com> - 2013-11-25 12:48 -0800
  Re: Getting the Appdata Directory with Python and PEP? Andrew Berg <robotsondrugs@gmail.com> - 2013-11-25 15:10 -0600
  Re: Getting the Appdata Directory with Python and PEP? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-25 21:20 +0000
  Re: Getting the Appdata Directory with Python and PEP? Eamonn Rea <eamonnrea@gmail.com> - 2013-11-26 10:09 -0800
    Re: Getting the Appdata Directory with Python and PEP? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-26 13:52 -0500
    Re: Getting the Appdata Directory with Python and PEP? Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2013-11-26 20:40 +0100
      Re: Getting the Appdata Directory with Python and PEP? Eamonn Rea <eamonnrea@gmail.com> - 2013-11-26 14:49 -0800
        Re: Getting the Appdata Directory with Python and PEP? Chris Angelico <rosuav@gmail.com> - 2013-11-27 10:20 +1100
          Re: Getting the Appdata Directory with Python and PEP? Eamonn Rea <eamonnrea@gmail.com> - 2013-11-28 08:11 -0800
            Re: Getting the Appdata Directory with Python and PEP? Chris Angelico <rosuav@gmail.com> - 2013-11-29 04:28 +1100
            Re: Getting the Appdata Directory with Python and PEP? rusi <rustompmody@gmail.com> - 2013-11-28 10:32 -0800
            Re: Getting the Appdata Directory with Python and PEP? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-28 16:29 -0500
        Re: Getting the Appdata Directory with Python and PEP? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-26 23:21 +0000
        Re: Getting the Appdata Directory with Python and PEP? Kevin Walzer <kw@codebykevin.com> - 2013-12-02 09:39 -0500

csiph-web