0
我用wx.lib.pubsub(Windows中,Python 2.6中)與py2exe編譯發佈訂閱
當解釋器中運行我的應用程序,發佈訂閱的版本是1
當我編譯和運行我的應用程序中, pubsub的版本是3
爲什麼? 如何強制編譯版本運行pubsub api v1?
from distutils.core import setup
import py2exe
from distutils.core import Distribution
setup(
console=[
dict(
script='test.py'
)
],
options={
'py2exe': {
'packages' : [
'wx.lib.pubsub'
],
'includes': [],
"excludes" : [],
"dll_excludes": [ 'tcl85.dll', 'tk85.dll', 'mswsock.dll', 'powrprof.dll']
}
},
)
from wx.lib.pubsub import pub
publisher = pub.Publisher()
print pub.PUBSUB_VERSION
EVENT_NAME = "test_pubsub"
def listener(data):
print data
publisher.subscribe(listener, EVENT_NAME)
publisher.sendMessage(EVENT_NAME, data="toto")
wxpython v 2.8.12.1 – user2920520 2014-09-05 07:14:47