[python-win32] clicking pyw file gives me a console

Tim Golden mail at timgolden.me.uk
Wed Jan 8 16:16:38 CET 2014


On 06/01/2014 16:59, Mark Lawrence wrote:
> As the subject :(  It only happens if I've a shebang line at the top of
> the file, remove that and the file is launched without the console.  If
> I add a w to the end of python on the shebang line I get a dialog box
> "Python launcher is sorry to say ...  Invalid version specification:
> 'w'"  I've 2.7, 3.3 and now the latest version of 3.4 installed on
> Windows 7.  How do I go about debugging this?  Section 3.4.1.3. of the
> "Using Python on Windows" docs simply state "The launcher should have
> been associated with Python files (i.e. .py, .pyw, .pyc, .pyo files)
> when it was installed".
>
> Below are the file types and associations which look fine to me.
>
> Python.CompiledFile="C:\Windows\py.exe" "%1" %*
> Python.File="C:\Windows\py.exe" "%1" %*
> Python.NoConFile="C:\Windows\pyw.exe" "%1" %*
>
> .py=Python.File
> .pyc=Python.CompiledFile
> .pyo=Python.CompiledFile
> .pyw=Python.NoConFile

Mark -- does this happen only if you double-click or also if you run the 
file from the command line? By that I mean somthing like:

c:\users\tim> myfile.py

I ask because the Shell/Explorer (the program handling the double-click) 
has its own association mechanism. Usually it matches the settings you 
list above, but it doesn't have to.


TJG


More information about the python-win32 mailing list