Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'subject:Windows': 0.02; 'from:addr:yahoo.co.uk': 0.04; 'subject:Python': 0.06; 'subject:Questions': 0.07; "'python": 0.09; 'badly': 0.09; 'executable': 0.09; 'latter': 0.09; 'lawrence': 0.09; 'present,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runs': 0.10; 'python': 0.11; 'language.': 0.14; 'windows': 0.15; '.py': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'renaming': 0.16; 'subject:Two': 0.16; 'language': 0.16; 'wrote:': 0.18; 'normally': 0.19; 'thu,': 0.19; '(the': 0.22; '>>>': 0.22; 'creating': 0.23; 'header:User- Agent:1': 0.23; 'versions': 0.24; 'file.': 0.24; '---': 0.24; 'question': 0.24; 'script': 0.25; 'second': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'skip:p 30': 0.29; 'am,': 0.29; 'linux.': 0.31; 'yes.': 0.31; 'file': 0.32; 'run': 0.32; 'copying': 0.34; '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; 'received:org': 0.40; 'how': 0.40; 'associates': 0.60; 'ian': 0.60; 'free': 0.61; 'viruses': 0.61; 'simply': 0.61; 'protection': 0.63; 'our': 0.64; 'more': 0.64; 'school': 0.64; 'between': 0.67; 'antivirus': 0.68; 'freebsd': 0.84; 'hand.': 0.84; 'installer': 0.84; 'received:2': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Two Questions about Python on Windows Date: Thu, 03 Apr 2014 23:57:31 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-98-192-106.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: X-Antivirus: avast! (VPS 140403-1, 03/04/2014), Outbound message X-Antivirus-Status: Clean 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: 62 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396565869 news.xs4all.nl 2914 [2001:888:2000:d::a6]:45499 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69620 On 03/04/2014 23:41, Ian Kelly wrote: > 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. > Yes, I regretted how badly I worded the above the second I hit the send button. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com