[python-win32] running a python script on WinXP by icon double-clicking.

Tim Roberts timr at probo.com
Wed Aug 4 18:56:21 CEST 2010


 Vineet Deodhar wrote:
> I have created a py2.6 script for a simple GUI with Tkinter.
> Saved it with .py extension and also as .pyw extension.
> ...
> 1) When run from command prompt as ---
> D:\py>python entry.py
> it runs nicely.
>
> 2) If I double-click on either entry.py or entry.pyw file,
> nothing happens (no DOS console window to show any error also).
>
> Any idea how should I run this with double-click on icon!
>
>

Does it run if you type just the file name?  For example:
    D:\py>entry.py
or
    D:\py>entry.pyw

If it runs like that, then it should run from a double-click.  Do you
have multiple versions of Python installed?  Is "Quitter.py" in the same
directory as the script?  Can you check the associations from a command
line using the assoc and ftype commands, like this:

C:\tmp>assoc .py
.py=Python.File

C:\tmp>assoc .pyw
.pyw=Python.NoConFile

C:\tmp>ftype python.file
python.file="C:\Apps\Python26\python.exe" "%1" %*

C:\tmp>ftype python.noconfile
python.noconfile="C:\Apps\Python26\pythonw.exe" "%1" %*

Your path will probably be different, but the philosophy should be the same.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list