我有一个附有GUI的python脚本。该GUI具有放置目标,当其中放置了某些内容以切换到下一个窗口时,它会利用pubsub发送消息。
class FileDrop(wx.FileDropTarget):
def __init__(self, window):
wx.FileDropTarget.__init__(self)
self.window = window
def OnDropFiles(self, x, y, filenames):
for name in filenames:
filename = name
if filename != "":
print(filename)
pub.sendMessage('dnd', filepath=filename)
return True
后来有
pub.subscribe(self.update, 'dnd')
其中self.update是用于更改窗口显示的功能。
这在本地运行程序时有效。但是,当我将其制成可执行文件并尝试运行它时,放置目标屏幕永远不会改变。为了使它正常工作,我需要做些特别的事情吗?
谢谢!