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


Groups > comp.lang.python > #103211

Re: extending PATH on Windows?

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From eryk sun <eryksun@gmail.com>
Newsgroups comp.lang.python
Subject Re: extending PATH on Windows?
Date Fri, 19 Feb 2016 12:07:24 -0600
Lines 28
Message-ID <mailman.56.1455905293.2289.python-list@python.org> (permalink)
References <n9umo3$9lg$1@news2.informatik.uni-stuttgart.de> <mailman.160.1455625190.22075.python-list@python.org> <n9v58k$dcl$1@news2.informatik.uni-stuttgart.de> <mailman.168.1455630261.22075.python-list@python.org> <na2bqn$7d7$1@news2.informatik.uni-stuttgart.de> <mailman.217.1455735785.22075.python-list@python.org> <na2l7h$a97$1@news2.informatik.uni-stuttgart.de> <mailman.222.1455743909.22075.python-list@python.org> <na2sn9$c49$1@news2.informatik.uni-stuttgart.de> <na4t21$skl$3@news2.informatik.uni-stuttgart.de>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de KR5cepCjyTWuBMaPm1pHjQhmLOOBw13gZahouhhkR/MQ==
Return-Path <eryksun@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'received:209.85.223': 0.03; 'url:msdn': 0.07; 'subject:Windows': 0.09; '[1]:': 0.09; '[2]:': 0.09; 'def': 0.13; 'thu,': 0.15; '2016': 0.16; 'node,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'registry': 0.16; 'wrote:': 0.16; 'try:': 0.18; 'cc:2**0': 0.20; 'parameter': 0.22; 'simpler': 0.22; 'am,': 0.23; 'feb': 0.23; 'header:In-Reply- To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; '[2]': 0.27; 'values': 0.28; 'similar': 0.33; 'except': 0.34; 'received:google.com': 0.35; 'but': 0.36; 'should': 0.36; 'received:209.85': 0.36; 'data.': 0.36; 'url:library': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'data': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'more': 0.63; 'different': 0.63; 'skip:w 30': 0.64; 'url:en-us': 0.72; 'skip:w 60': 0.84; 'streams': 0.84; 'studying': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=cxpJ4q78b0/II8fSIp8MP3mw/QESeGUpqPfmgI0u5ac=; b=DyyONpEW9zmGHfoUWwZrLBcvZQdwAHgSvzm4pV03/SUKowIXV3aHXB0EnkqLT5rsKo B1jXppPGdPlzs5U4StGwKCLLXbKiTpcMasxiLMpStKgwlM1YK269CebnFupEyKyNzXMZ yTOgmL/fffaLWUDZKYnIUf/Gwq3GmaMXNAhABWEzyWDUXctSHaLz4vk2lfHNRRRWEtY0 V9bXddB+w/FjgAEhcEQQJ19KFMCwf5KHKOz/22SxWCF4ModM6vkHtUbA3OMKd7bcw1Zw YdVcd8KuAgdOSb3JJXqtOAD9GDU+XRe1PEpwE7dpDnHuzubFb1JyH9ZPDmVXO82BDlf3 3fUg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=cxpJ4q78b0/II8fSIp8MP3mw/QESeGUpqPfmgI0u5ac=; b=REuavrWztAu5KVmQIjctLlLno/e6p8d6PlT2/PIMFbXZLUrO6pRufeFlTWDoqsG9z6 VlTq1TbdWUNr/eO25NfqVmbuZVhDtf/OQSlND1TuvUC5pDw02j2DEGDkDreraYPdRhWZ h/P6B6SRzvFi4tKh6c//4tMi+ngKQBdvqvwbTcW3/2jBl8NrBPblCKSC/sz9AZfGEeQr z7Q3NU5m3ChfKCtHPui+EmyZl2KeX1g4/S8yt6Grgab+QeaHxlStrA0qxUFoRE1jIS8+ EVGoYzryhwMu5aiWVZ54DU/7VgDQgcg1TiUNJvjH1l/oxITSMWg4FVnwHeROy/coxo4r gfOA==
X-Gm-Message-State AG10YOTpzKeRdaBrsBv+auUTnqn71tAuimXDcQ3BxKN0bNP6XN2sBZcfwSpCMwIRummNN1XW7YvhxXghF4scqQ==
X-Received by 10.107.10.158 with SMTP id 30mr15464675iok.73.1455905284217; Fri, 19 Feb 2016 10:08:04 -0800 (PST)
In-Reply-To <na4t21$skl$3@news2.informatik.uni-stuttgart.de>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21rc2
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>
Xref csiph.com comp.lang.python:103211

Show key headers only | View raw


On Thu, Feb 18, 2016 at 10:55 AM, Ulli Horlacher
<framstag@rus.uni-stuttgart.de> wrote:
> Ulli Horlacher <framstag@rus.uni-stuttgart.de> wrote:
>
>> > but simpler still and more reliable to just call QueryValueEx.
>>
>> I find it more complicated.
>
> I have now (after long studying docs and examples)::
>
> def get_winreg(key,subkey):
>   try:
>     rkey = winreg.OpenKey(winreg.HKEY_CURRENT_USER,key,0,winreg.KEY_READ)
>     rvalue,rtype = winreg.QueryValueEx(rkey,subkey)
>     winreg.CloseKey(rkey)
>   except WindowsError:
>     rvalue,rtype = None,None
>   return rvalue

The 2nd parameter should be named "value_name", not "subkey".

A registry key is similar to an NTFS file-system node, and values are
similar to NTFS $DATA streams [1], but with different types of data
[2] other than just REG_BINARY, to make it easier to store structured
configuration data.

[1]: https://msdn.microsoft.com/en-us/library/aa364404
[2]: https://msdn.microsoft.com/en-us/library/ms724884

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


Thread

extending PATH on Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2016-02-16 08:30 +0000
  Re: extending PATH on Windows? Thorsten Kampe <thorsten@thorstenkampe.de> - 2016-02-16 13:19 +0100
    Re: extending PATH on Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2016-02-16 12:38 +0000
      Re: extending PATH on Windows? Thorsten Kampe <thorsten@thorstenkampe.de> - 2016-02-16 14:38 +0100
      Re: extending PATH on Windows? Thorsten Kampe <thorsten@thorstenkampe.de> - 2016-02-16 14:43 +0100
        Re: extending PATH on Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2016-02-17 17:49 +0000
          Re: extending PATH on Windows? eryk sun <eryksun@gmail.com> - 2016-02-17 13:02 -0600
            Re: extending PATH on Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2016-02-17 20:29 +0000
              Re: extending PATH on Windows? eryk sun <eryksun@gmail.com> - 2016-02-17 15:17 -0600
                Re: extending PATH on Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2016-02-17 22:37 +0000
                Re: extending PATH on Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2016-02-18 16:55 +0000
                Re: extending PATH on Windows? eryk sun <eryksun@gmail.com> - 2016-02-19 12:07 -0600
          Re: extending PATH on Windows? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-02-17 19:53 -0500
            Re: extending PATH on Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2016-02-18 16:24 +0000
              Re: extending PATH on Windows? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-02-18 21:57 -0500
                Re: extending PATH on Windows? pyotr filipivich <phamp@mindspring.com> - 2016-02-18 19:39 -0800
                Re: extending PATH on Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2016-02-19 10:42 +0000
                Re: extending PATH on Windows? Chris Angelico <rosuav@gmail.com> - 2016-02-19 21:48 +1100
                Re: extending PATH on Windows? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-02-19 07:45 -0500
                Re: extending PATH on Windows? Gisle Vanem <gvanem@yahoo.no> - 2016-02-19 15:18 +0100
                Re: extending PATH on Windows? pyotr filipivich <phamp@mindspring.com> - 2016-02-19 09:04 -0800
                Re: extending PATH on Windows? eryk sun <eryksun@gmail.com> - 2016-02-19 12:04 -0600
                Re: extending PATH on Windows? eryk sun <eryksun@gmail.com> - 2016-02-19 12:42 -0600
                Re: extending PATH on Windows? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-02-19 19:57 -0500
                Re: extending PATH on Windows? eryk sun <eryksun@gmail.com> - 2016-02-20 07:31 -0600
          Re: extending PATH on Windows? eryk sun <eryksun@gmail.com> - 2016-02-18 06:54 -0600
            Re: extending PATH on Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2016-02-18 16:50 +0000
  Re: extending PATH on Windows? eryk sun <eryksun@gmail.com> - 2016-02-16 07:17 -0600

csiph-web