Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4a.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'subject:Windows': 0.02; 'subject:Python': 0.06; 'subject:Questions': 0.07; "'python": 0.09; 'executable': 0.09; 'latter': 0.09; 'lawrence': 0.09; 'present,': 0.09; 'runs': 0.10; 'python': 0.11; 'windows': 0.15; '.py': 0.16; 'renaming': 0.16; 'subject:Two': 0.16; 'wrote:': 0.18; 'normally': 0.19; 'thu,': 0.19; '(the': 0.22; 'creating': 0.23; 'versions': 0.24; 'file.': 0.24; 'question': 0.24; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'skip:p 30': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'linux.': 0.31; 'yes.': 0.31; 'file': 0.32; 'run': 0.32; 'copying': 0.34; 'received:google.com': 0.35; 'version': 0.36; 'done': 0.36; 'detail': 0.37; 'skip:. 20': 0.38; 'window': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'skip:. 10': 0.39; 'to:addr:python.org': 0.39; 'associates': 0.60; 'ian': 0.60; 'simply': 0.61; 'more': 0.64; 'school': 0.64; 'between': 0.67; 'freebsd': 0.84; 'hand.': 0.84; 'installer': 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 :content-type; bh=40r/751wBljqNJ/jtLeZmzZJjcyfpxtREolH50Xqn1E=; b=xJLeCursCNr8U28fX4KVDEHxCvw33z9H135UYapIl7N0YOh29gf55Mtv72fl0lKY4T NKDmx9tvxM4g68G6Kj3xwYk8TxSyMgmY+ld2qeHfHUrg+xMVT3pOB0MOsML9XGjiYQBw /+qk8w5DT41aC/9RERKjL1/w9AMUSDk4PKNxini/uzTF8tJ3/dCilybkP7Rlh05+n0tT zulyyM6GeoE2oSN8YsD+pDdY5Kr9rDACs93j6GzGTOQs3b4F6aXMHmyJ/V0I66jtfN32 Zzlr0CyJ1zzn9zyG48QJToddH0/Ln/psSHdP/b6U7Xzfu6ZU8hFTgJRt7qMb3o+KMLbL lJJA== X-Received: by 10.69.17.230 with SMTP id gh6mr10892954pbd.0.1396564932020; Thu, 03 Apr 2014 15:42:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Thu, 3 Apr 2014 16:41:31 -0600 Subject: Re: Two Questions about Python on Windows To: Python Content-Type: text/plain; charset=ISO-8859-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: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396564935 news.xs4all.nl 2930 [2001:888:2000:d::a6]:59257 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69617 On Thu, Apr 3, 2014 at 2:15 PM, Mark Lawrence wrote: > On 03/04/2014 18:54, Ian Kelly wrote: >> >> >> On Apr 3, 2014 11:12 AM, "Walter Hurry" > > wrote: >> > >> > Normally my Python development is done on FreeBSD and Linux. I know >> that on *ix I simply have to make foo.py executable (the shebang line is >> present, of course) to make it runnable. >> > >> > For my son's school assignment, I have to help him with Python for >> Windows. >> > >> > As I understand it, on Windows a .py file is not executable, so I >> need to run 'python foo py', or use a .pyw file. >> > >> > Question 1: Do I make a .pyw file simply by copying or renaming >> foo.py to foo.pyw? >> >> Yes. The only distinction between .py and .pyw is that the Python >> installer associates the former with Python.exe and the latter with >> Pythonw.exe. Pythonw runs the script without creating a console window >> for stdin/stdout. >> > > Not with more modern versions of Python. > > c:\Users\Mark>assoc .py > .py=Python.File > > c:\Users\Mark>ftype Python.File > Python.File="C:\Windows\py.exe" "%1" %* Which ultimately calls some version of python.exe. > c:\Users\Mark>assoc .pyw > .pyw=Python.NoConFile > > c:\Users\Mark>ftype Python.NoConFile > Python.NoConFile="C:\Windows\pyw.exe" "%1" %* Which ultimately calls some version of pythonw.exe. I elided that detail because it wasn't relevant to the question at hand.