[python-win32] running py app by doubleclick on Win32
Vineet Deodhar
d_vineet at yahoo.com
Thu Aug 5 15:45:17 CEST 2010
Dear all,
As you all suggested, my python installations are messed-up.
There are py2.6 and py3.1 ( py3.1 at two different locations) versions installed.
Although I have set the PYTHONPATH variable correctly to run py2.6 version, I wonder how the py3.1 takes control while running any py script!!!
In my code, I am importing Tkinter (i.e.py 2.6 syntax).
When py3.1 encounters Tkinter, it is giving exception and the program execution halts.
Anyway, I will uninstall all and reinstall py2.6
(Oh Ma! I need to reinstall all other site-packages like MySQLdb, PyQt, etc.)
Then let me again experiment again.
Thanks,
Vineet
---------------------------------------------------------------------------------
--- On Thu, 5/8/10, python-win32-request at python.org <python-win32-request at python.org> wrote:
From: python-win32-request at python.org <python-win32-request at python.org>
Subject: python-win32 Digest, Vol 89, Issue 3
To: python-win32 at python.org
Date: Thursday, 5 August, 2010, 15:30
Send python-win32 mailing list submissions to
python-win32 at python.org
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/python-win32
or, via email, send a message with subject or body 'help' to
python-win32-request at python.org
You can reach the person managing the list at
python-win32-owner at python.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of python-win32 digest..."
Today's Topics:
1. Re: running a python script on WinXP by icon double-clicking.
(Tim Roberts)
2. Re: running a python script on WinXP by icon double-clicking.
(Gelonida)
3. Wanted: Win32-savvy developers for core Python (Tim Golden)
----------------------------------------------------------------------
Message: 1
Date: Wed, 4 Aug 2010 09:56:21 -0700
From: Tim Roberts <timr at probo.com>
To: Python-Win32 List <python-win32 at python.org>
Subject: Re: [python-win32] running a python script on WinXP by icon
double-clicking.
Message-ID: <4C599BB5.7050802 at probo.com>
Content-Type: text/plain; charset="ISO-8859-1"
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.
------------------------------
Message: 2
Date: Thu, 05 Aug 2010 09:04:58 +0200
From: Gelonida <gelonida at gmail.com>
To: python-win32 at python.org
Subject: Re: [python-win32] running a python script on WinXP by icon
double-clicking.
Message-ID: <i3dnqq$66i$1 at dough.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1
Hi Vineet,
Could you please post the output of the
ftype and the assoc commands?
As Tim asked in his post:
Could you try to start the script from a command prompt without the
preceding python command?
So instead of typing:
python entry.py
just type
entry.py
tell us what happens
On 08/04/2010 10:02 AM, Vineet Deodhar wrote:
> Hi Kevin,
> I checked "Opens with" option for .py and .pyw files.
> Associations are correct.
>
> This problem happens for any python script file, not just this-one.
> Do I really need to remove & reinstall py26, or can there any other option !
>
> ---Vineet.
>
>
>
> --- On Wed, 4/8/10, Kevin Horn <kevin.horn at gmail.com> wrote:
>
> From: Kevin Horn <kevin.horn at gmail.com>
> Subject: Re: [python-win32] running a python script on WinXP by icon double-clicking.
> To: "Vineet Deodhar" <d_vineet at yahoo.com>
> Date: Wednesday, 4 August, 2010, 12:11
>
> First check that .py or .pyw files are associated with the proper executables.
>
> from an explorer window, choose Tools -> Folder Options
> then click on the file types tab
>
> find the PY and PYW entries in the list, and make sure their "Opens with" entries are correct
>
>
> PY -> python.exe
> PY -> pythonw.exe
>
> If those are correct, and you still have problems, then perhaps your python installation is messed up somehow,
> or there's something really strange about your script.
>
>
> Hope this helps,
> Kevin Horn
>
> On Wed, Aug 4, 2010 at 1:30 AM, Vineet Deodhar <d_vineet at yahoo.com> wrote:
>
> 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.
>
>
>
>
>
> _______________________________________________
>
> python-win32 mailing list
>
> python-win32 at python.org
>
> http://mail.python.org/mailman/listinfo/python-win32
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
------------------------------
Message: 3
Date: Thu, 05 Aug 2010 10:49:58 +0100
From: Tim Golden <mail at timgolden.me.uk>
To: Python-Win32 List <python-win32 at python.org>
Subject: [python-win32] Wanted: Win32-savvy developers for core Python
Message-ID: <4C5A8946.40407 at timgolden.me.uk>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Please see my blog post on the subject:
http://ramblings.timgolden.me.uk/2010/08/05/wanted-win32-savvy-developers-for-core-python/
In short: give us a hand, please.
TJG
------------------------------
_______________________________________________
python-win32 mailing list
python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32
End of python-win32 Digest, Vol 89, Issue 3
*******************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20100805/8e043dd7/attachment.html>
More information about the python-win32
mailing list