mentby.com
Blog | Jobs | Help | Signup | Login

Hi all,
I have a project which uses wx for a particular function. When the
project runs from source, this function works fine. When compiled
using py2exe, though, and then run from the .exe on a computer without
python installed, I get an exception "none type object has no
attribute 'Bind'" and it crashes. What is going on? Thanks.

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap*******/mehgcap

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Alex Hall Sun, 25 Apr 2010 20:06:53 -0700

Which version are you using?
You have given none type bind methed.

äº=8E 2010-4-26 11:06, Alex Hall å=86=99é=81“:

--
To unsubscribe, send email to wxPython-users unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Wang Zhaohe Sun, 25 Apr 2010 21:14:38 -0700

--------------------------------------------------


GadgetSteve Sun, 25 Apr 2010 22:09:30 -0700

What is the line that causes the error?  What is on the left side of the
".Bind" on that line?  Where does that come from?

--
Robin Dunn
Software Craftsman http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Robin Dunn Mon, 26 Apr 2010 10:29:58 -0700

self.mf.Bind(wx.EVT_KEY_DOWN, self.onKeyDown) #to close the dialog
on pressing "esc"

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap*******/mehgcap

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Alex Hall Wed, 28 Apr 2010 09:56:57 -0700

What is self.mf and where does it come from?

--
Robin Dunn
Software Craftsman http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Robin Dunn Wed, 28 Apr 2010 10:11:19 -0700

It is the main frame of the window. Again, the entire thing works
perfectly when run from source, I just get this error when running
from the compiled .exe file.

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap*******/mehgcap

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Alex Hall Wed, 28 Apr 2010 10:16:55 -0700

What I'm trying to ask is if self.mf is created in code directly of if
is is created with something like XRC.  If so then the problem could be
that the XRC file is not found and so it is returning None.

--
Robin Dunn
Software Craftsman http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Robin Dunn Wed, 28 Apr 2010 10:20:24 -0700

Ah, that seems to be a possibility. I figured py2exe was smart enough
to see that dict.xrc was being read by dict.py and so would include
it, but my library.zip file does not seem to contain dict.xrc (from
which the program gets all its output). Thanks; when I get home I will
update my setup.py and try again!>

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap*******/mehgcap

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Alex Hall Wed, 28 Apr 2010 10:28:29 -0700

I have a (possibly) related problem that a call to subprocess.Popen(cmds,
stdout=subprocess.PIPE) works fine from source but fails with an error
'invalid handle' when converted with py2exe - unfortunately I have to have
the output to parse as I do not get the error with no
stdout=subprocess.PIPE - I am considering using os.system with a pipe to a
file or wx.Process if I can not find a better solution.

Any suggestions?

Gadget/Steve

--------------------------------------------------


GadgetSteve Wed, 28 Apr 2010 12:09:30 -0700

http://www.py2exe.org/index.cgi/Py2ExeSubprocessInteractions

--
Steven Sproat, BSc http://www.launchpad.net/whyteboard

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Steven Sproat Wed, 28 Apr 2010 12:32:50 -0700

Hello,

I'm not at all an expert in this, but got a similar problem and found
somewhere on the web that adding stdout.close() is a possible
workaround. So:

proc = subprocess.Popen(cmds, stdout=subprocess.PIPE)
proc.communicate()
proc.stdout.close()

May be that helps, at least it did for me (but with stdin and stderr)
It was described as a bug, but seems to never have been fixed.

Raphael

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Raphael Mayoraz Wed, 28 Apr 2010 12:36:20 -0700

XRC wouldn't be able to load it from library.zip anyway.  You'll need to
include the file in addition to the files assembled by py2exe, and
update your code to be able to find it at runtime.

--
Robin Dunn
Software Craftsman http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Robin Dunn Wed, 28 Apr 2010 16:35:48 -0700

--------------------------------------------------


GadgetSteve Wed, 28 Apr 2010 17:07:23 -0700

--------------------------------------------------


GadgetSteve Wed, 28 Apr 2010 17:08:40 -0700

Thanks! My program now works as expected, from source AND from the
compiled file. Now I just have to write documentation and the beta is
ready!

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap*******/mehgcap

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


Alex Hall Thu, 29 Apr 2010 07:29:39 -0700

Alex,

Maybe do a page in the wiki with your solution for XRC and py2exe and
link it or add it to this page:

http://wiki.wxpython.org/py2exe

Or alternatively on the py2exe wiki.

Werner

--
To unsubscribe, send email to wxPython-users+unsubscribe*******
or visit  http://groups.google.com/group/wxPython-users?hl=en


werner Fri, 30 Apr 2010 02:19:36 -0700



Related Topics

Post a Comment