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

Vineet Deodhar d_vineet at yahoo.com
Wed Aug 4 08:30:42 CEST 2010


I have created a py2.6 script for a simple GUI with Tkinter.
Saved it with .py extension and also as .pyw extension.

filename is entry.py
[CODE]
from Tkinter import *
from quitter import Quitter

def fetch():
    print('Input => "%s"' % ent.get())

root = Tk()
ent = Entry(root)
ent.show='@'
ent.insert(0, 'Type words here')
ent.pack(side=TOP, fill=X)

ent.focus()
ent.bind('<Return>', (lambda event: fetch()))
btn = Button(root, text='Fetch', command=fetch)
btn.pack(side=LEFT)
Quitter(root).pack(side=RIGHT)
root.mainloop()
[/CODE]

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!

Thanks,
Vineet.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20100803/3e6ea5fd/attachment.html>


More information about the python-win32 mailing list