Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!fdn.fr!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'scripts': 0.03; 'interpreter': 0.05; 'subject:Python': 0.06; 'versions,': 0.07; 'versions.': 0.07; 'executable': 0.09; 'mess': 0.09; 'separately': 0.09; 'variable,': 0.09; 'python': 0.11; '2.7': 0.14; '.py': 0.16; 'path.': 0.16; 'subject:windows': 0.16; 'windows?': 0.16; 'extensions': 0.16; 'wrote:': 0.18; 'version.': 0.19; 'header :User-Agent:1': 0.23; 'finally,': 0.24; "i've": 0.25; 'equivalent': 0.26; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'newer': 0.30; 'file': 0.32; 'stuff': 0.32; 'linux': 0.33; 'up.': 0.33; 'older': 0.33; 'skip:# 10': 0.33; 'problem': 0.35; 'there': 0.35; 'depends': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'heard': 0.39; 'use.': 0.39; 'to:addr:python.org': 0.39; 'ensure': 0.60; 'subject: ': 0.61; 'first': 0.61; 'charset:windows-1252': 0.65; 'between': 0.67; 'line,': 0.68; 'reads': 0.68; 'received:74.208': 0.68; 'cut': 0.74; 'loose': 0.84; 'wipe': 0.84 Date: Fri, 20 Feb 2015 09:51:53 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Python path on windows References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:5+PLkpo1K5rlPUia8PF0Azr8G43D7MqA3r82dw2dPny e5fUhQVzWu50L09P8dmPstZh1zUrKpkUa95txolkHgHKmfF1KD OXAtlne83imQQfQPx3hIgq8JrOExLnK5IvW2bfBMSErkBpq1D0 GG+FEOxXcxGE3Vh4Ro+k0IcFxIAcgul9Kmoc15wdCFioNcuo11 xa42XCG91oM5svYA2e9JuFoZt9sSPtMAcjQCJyj5hWRlJP6Vwc mGO59r5uBgw4SmRW3/jkNuHfAejVTZ+zp4N/6HBb17jj+MbifS LF8R/t4noAgAXYvyfdqpFHgjDfwUeaIdCWlwtWaNG/IRD+azAk oN26aLTH7tSY64Eov9Os= X-UI-Out-Filterresults: notjunk:1; X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424443933 news.xs4all.nl 2925 [2001:888:2000:d::a6]:57997 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85974 On 02/20/2015 09:43 AM, loial wrote: > On Linux we use > #!/usr/bin/env python > > At the start of scripts to ensure that the python executable used is the one defined in the PATH variable, rather than hardcoding a path to the python executable. > > What is the equivalent functionality in Windows? > Depends on Python version. In newer versions, there is a py.exe file which they put on their path. Then in the registry is a two-stage association between the .py and .pyw extensions and the above executable. Finally, when py.exe starts, it reads that first (shebang) line, and decides which python interpreter to actually use. One problem I've heard about is that if someone installs 2.7 on top of 3.x, it can wipe out the file associations, and mess this stuff up. The py.exe can be separately installed, to use on older python versions. This all happened after I cut loose from Windows. -- DaveA