wxpython

Can I generate a python executable file on my Mac that can be used on Windows

社会主义新天地 提交于 2020-01-16 06:11:07
问题 I am programming python with my Mac laptop, however, the final executable will be run on final users' Windows system. And the Windows system hasn't set up the python environment specifically. Can I generate an executable file on my Mac laptop, and Windows user can directly run on Windows system? I looked at py2exe, but it seems it must build the python on Windows in order to run the exe on Windows. 回答1: You can not generate Windows executable files on OS X. You must use the platform which you

Slow GUI update of a wx (Python) widget?

心已入冬 提交于 2020-01-16 04:56:07
问题 Consider this example (tried on python2.7, Ubuntu 11.04): import wx import wx.lib.agw.knobctrl as KC # started from: http://wxpython.org/Phoenix/docs/html/lib.agw.knobctrl.html class MyFrame(wx.Frame): def __init__(self, parent): wx.Frame.__init__(self, parent, -1, "KnobCtrl Demo") self.panel = wx.Panel(self) self.knob1 = KC.KnobCtrl(self, -1, size=(100, 100)) self.knob1.SetTags(range(0, 151, 10)) self.knob1.SetAngularRange(-45, 225) self.knob1.SetValue(45) # explicit sizes here - cannot

pyinstaller exe with pubsub

耗尽温柔 提交于 2020-01-16 01:14:12
问题 I have written a wxpython application that uses several different threads all of which need to write to the log window (textctrl box). Because of this I followed this tutorial http://www.blog.pythonlibrary.org/2010/05/22/wxpython-and-threads/ And used wx.CallAfter and PubSub. This was my original code from wx.lib.pubsub import Publisher Publisher().subscribe(self.messenger, "update") wx.CallAfter(Publisher().sendMessage, "update", "Thread finished!") def messenger(self, msg): self.logtxtctrl

wxPython: Problems with thread

天大地大妈咪最大 提交于 2020-01-15 11:26:06
问题 My program keeps expanding. In my MainProgram method in the MainPanel class I'm using some functions from an other program. While using this the GUI hangs until that is finished and I want to solve this by using a new thread for this method. While doing this I get an error when executing OnRun. It says: Unhandled exception in thread started by <bound method MainPanel.OnIndex of <__main__.MainPanel; proxy of <Swig Object of type 'wxPanel *' at 0x526e238> >> It think this has something to do

Window-overflowing widget in wxWidgets

扶醉桌前 提交于 2020-01-15 11:08:10
问题 I'm looking for a way to implement this design in wxPython on Linux... I have a toolbar with a button, when the button is pressed a popup should appear, mimicking an extension of the toolbar (like a menu), and this popup should show two columns of radio buttons (say 2x5) and a text box... My main problem is that the toolbar is small in height, so the popup has to overflow the bounds of the window/client area.. I thought of two possible implementations: by using a wxMenu, since a menu can be

Window-overflowing widget in wxWidgets

↘锁芯ラ 提交于 2020-01-15 11:08:09
问题 I'm looking for a way to implement this design in wxPython on Linux... I have a toolbar with a button, when the button is pressed a popup should appear, mimicking an extension of the toolbar (like a menu), and this popup should show two columns of radio buttons (say 2x5) and a text box... My main problem is that the toolbar is small in height, so the popup has to overflow the bounds of the window/client area.. I thought of two possible implementations: by using a wxMenu, since a menu can be

wxPython file dialog error: missing “|” in the wildcard string!

…衆ロ難τιáo~ 提交于 2020-01-14 02:49:07
问题 I am on Windows7, using Python 2.6 and wxPython 2.8.10.1. I am trying to get this Open File dialog to work but am running into a weird error. This looks like a valid wildcard string to me, but whenever I choose a file and click 'Ok' on the File Dialog, I get this: Traceback (most recent call last): File "D:\Projects\python\wxTest.py", line 92, in OnOpen self.__DoOpen() File "D:\Projects\python\wxTest.py", line 101, in __DoOpen if open_dlg.ShowModal() == wx.ID_OK: File "C:\Python26\lib\site

Find text dialog with wxpython

99封情书 提交于 2020-01-11 12:21:28
问题 Does anyone have a very simple example of using a find dialog with a text component in wxpython? Thanks in advance. 回答1: The use of wx.FindReplaceDialog is not so straighforward as we could expect from its name. This dialog gives you a dialog widget with parameters and entries for a search (or replace) action, You can read these parameters and the string to find from the dialog (actually from the event or from the wx.FindReplaceData object). However reading, searching and/or replacing on a

Find text dialog with wxpython

谁说我不能喝 提交于 2020-01-11 12:21:16
问题 Does anyone have a very simple example of using a find dialog with a text component in wxpython? Thanks in advance. 回答1: The use of wx.FindReplaceDialog is not so straighforward as we could expect from its name. This dialog gives you a dialog widget with parameters and entries for a search (or replace) action, You can read these parameters and the string to find from the dialog (actually from the event or from the wx.FindReplaceData object). However reading, searching and/or replacing on a

wxpython 例子

三世轮回 提交于 2020-01-08 13:01:05
#!/usr/bin/env python #coding:utf-8 import wx class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,-1,"My Frame",size=(300,300)) panel = wx.Panel(self,-1) panel.Bind(wx.EVT_MOTION,self.OnMove) wx.StaticText(panel,-1,"Pos:",pos=(10,12)) self.posCtrl = wx.TextCtrl(panel,-1,"",pos=(40,10)) def OnMove(self,event): pos = event.GetPosition() self.posCtrl.SetValue("%s,%s" % (pos.x,pos.y)) if __name__ == '__main__': app = wx.PySimpleApp() frame = MyFrame() frame.Show(True) app.MainLoop() 来源: https://www.cnblogs.com/quqiufeng/archive/2011/11/08/2240839.html