-------- Original Message --------
Subject: Py2exe and wxPython
Date: Wed, 28 Nov 2007 19:45:12 -0800
From: Paul Cornelius <paul.cornelius@...>
Organization: VueMetrix
To: py2exe-users@...
All:
I am having a strange problem with a py2exe/wxPython application and I'm
hoping someone can point me in the right direction. I have been
distributing a wxPython application with py2exe for some time, and have
not encountered any difficulties until recently. I added a number of
"ToolTips" to the application and was surprised to discover that the
tool tips appear normally when I run the program from a command line
with the Python interpreter, but they do not appear in the application
when I package it for distribution with py2exe. To make matters even
weirder, the behavior of the py2exe version differs across computers: on
some computers the tool tips appear as they should, but on others they
don't. In the Python interpreter environment they always appear. All
computers are running Windows XP.
I'm guessing this is some kind of Windows-related problem, but I don't
even know where to look. I used "Dependency Walker" to investigate any
differences in Windows .dll dependencies. When I run the same
executable on two different machines, one where the tool tips work and
one where they don't, I see 21 differences in the .dlls loaded, in their
dates or version numbers. I can't use Dependency Walker to compare the
.py and .exe versions on the same computer, which as far as I can tell
are absolutely identical in behavior except for the ToolTips.
What are the differences between a py2exe executable and the .py script
from which it is built? How can such a subtle differences in behavior
be explained?
Here is the simplest program I can come up with that illustrates the
problem:
import wx
class MainWindow(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Test tool tips")
butt = wx.Button(self,-1,"Press me")
s = "Go ahead, make my day"
butt.SetToolTip(wx.ToolTip(s))
self.Show(True)
def runapp():
app = wx.PySimpleApp()
MainWindow()
app.MainLoop()
runapp()
And here is the setup.py script to build an .exe:
import py2exe
from distutils.core import setup
win0 = {
"script" : "tt.py", # tt.py is the filename of the above script
}
setup(version="0.0",
description = "Test program for tool tips",
windows = [win0],
# options = {"py2exe": {"bundle_files" : 1,"optimize" :
2,"compressed" : 1}}
)
The .py script shows ToolTips and the .exe doesn't. I can remove the
comment before the last line and build again; that has no effect. I can
build the .exe as a console application instead of a window application,
and that also has no effect.
Any help (or even expressions of commiseration) would be greatly
appreciated.
Paul Cornelius
VueMetrix, Inc.
|