Py2EXE

Hi,

I have a huge problem getting my wxpython app compiled with py2exe. I
found a lot of stuff on google and the main message is..go back to an
older version ie 2.8.11.0.
Can anyone tell me where to get that version of wxpython ?

btw I've tried everything to get my app running...right now the error
is

TypeError: sendMessage() takes exactly 2 arguments (3 given)

I import like this:

from wx.lib.pubsub import setupv1 as psv1
from wx.lib.pubsub import Publisher

and call like this:

Publisher.subscribe(Publisher(),self.updateDisplay, "update")

and

Publisher.sendMessage(Publisher(),"update", amt)

Help would be much appreciated.

best regards

Hi,

Hi,

I have a huge problem getting my wxpython app compiled with py2exe. I
found a lot of stuff on google and the main message is..go back to an
older version ie 2.8.11.0.
Can anyone tell me where to get that version of wxpython ?

Same place you get the current one, sourceforge, but don't think that
is the solution to your issue.

btw I've tried everything to get my app running...right now the error
is

TypeError: sendMessage() takes exactly 2 arguments (3 given)

The error says your passing three arguments to sendMessage when it
only takes 2 arguments.

I import like this:

from wx.lib.pubsub import setupv1 as psv1
from wx.lib.pubsub import Publisher

and call like this:

Publisher.subscribe(Publisher(),self.updateDisplay, "update")

and

Publisher.sendMessage(Publisher(),"update", amt)

Why are you passing a Publisher instance as the first argument to sendMessage?

In Python 'self' is implicitly passed as the object to left of the '.'
operator.

Cody

···

On Tue, Feb 7, 2012 at 9:10 AM, Patrick Szabo <patmaster41@gmail.com> wrote:

Hi Patrick,

Hi,

I have a huge problem getting my wxpython app compiled with py2exe. I
found a lot of stuff on google and the main message is..go back to an
older version ie 2.8.11.0.
Can anyone tell me where to get that version of wxpython ?

btw I've tried everything to get my app running...right now the error
is

TypeError: sendMessage() takes exactly 2 arguments (3 given)

I import like this:

from wx.lib.pubsub import setupv1 as psv1
from wx.lib.pubsub import Publisher

and call like this:

Publisher.subscribe(Publisher(),self.updateDisplay, "update")

and

Publisher.sendMessage(Publisher(),"update", amt)

Help would be much appreciated.

There were some problems with pubsub and 2.8.11.0 and py2exe, at the time I got it to work by doing the following:

1. add an empty __init__.py to the folder wx.lib.pubsub.pubsub1 - should not be needed with more recent versions of wxPython
2. add 'wx.lib.pubsub' to "packages" within your setup.py.

As Cody pointed out you also have a problem with your subscribe/sendMessage calls.

Werner

P.S. If this is new stuff you are doing you should also look at the pubsub v3, i.e. using "setupkwargs" instead of "setupv1".
http://pubsub.sourceforge.net/recipes/upgrade_v1tov3.html

···

On 07/02/2012 16:10, Patrick Szabo wrote:

btw I’ve tried everything to get my app running…right now the error

is

Do you mean after upgrading? Or new application?

TypeError: sendMessage() takes exactly 2 arguments (3 given)

I import like this:

from wx.lib.pubsub import setupv1 as psv1

from wx.lib.pubsub import Publisher

and call like this:

Publisher.subscribe(Publisher(),self.updateDisplay, “update”)

and

Publisher.sendMessage(Publisher(),“update”, amt)

Patrick, are you building a new application? I’m wondering why you are using the deprecated API of pubsub. You should simply have to do

from wx.lib.pubsub import pub

pub.sendMessage(“topicName”, data1=something, data2=somethingElse)

or if you really insist on the nameless parameters

from wx.lib.pubsub import setuparg1

from wx.lib.pubsub import pub

pub.sendMessage(“topicName”, someStruct)

(and someStruct would be an object containing something and somethingElse from the previous example).

Oliver

···

On Tue, Feb 7, 2012 at 10:10 AM, Patrick Szabo patmaster41@gmail.com wrote: