wxpython

How can I create a simple message box in Python?

青春壹個敷衍的年華 提交于 2019-12-17 08:01:45
问题 I'm looking for the same effect as alert() in JavaScript. I wrote a simple web-based interpreter this afternoon using Twisted.web. You basically submit a block of Python code through a form, and the client comes and grabs it and executes it. I want to be able to make a simple popup message, without having to re-write a whole bunch of boilerplate wxPython or TkInter code every time (since the code gets submitted through a form and then disappears). I've tried tkMessageBox: import tkMessageBox

How can I create a simple message box in Python?

只愿长相守 提交于 2019-12-17 08:01:04
问题 I'm looking for the same effect as alert() in JavaScript. I wrote a simple web-based interpreter this afternoon using Twisted.web. You basically submit a block of Python code through a form, and the client comes and grabs it and executes it. I want to be able to make a simple popup message, without having to re-write a whole bunch of boilerplate wxPython or TkInter code every time (since the code gets submitted through a form and then disappears). I've tried tkMessageBox: import tkMessageBox

py2exe fails to generate an executable

守給你的承諾、 提交于 2019-12-17 06:28:14
问题 I am using python 2.6 on XP. I have just installed py2exe, and I can successfully create a simple hello.exe from a hello.py. However, when I try using py2exe on my real program, py2exe produces a few information messages but fails to generate anything in the dist folder. My setup.py looks like this: from distutils.core import setup import py2exe setup(console=['ServerManager.py']) and the py2exe output looks like this: python setup.py py2exe running py2exe creating C:\DevSource\Scripts

How to stop a looping thread in Python?

前提是你 提交于 2019-12-17 04:46:42
问题 What's the proper way to tell a looping thread to stop looping? I have a fairly simple program that pings a specified host in a separate threading.Thread class. In this class it sleeps 60 seconds, the runs again until the application quits. I'd like to implement a 'Stop' button in my wx.Frame to ask the looping thread to stop. It doesn't need to end the thread right away, it can just stop looping once it wakes up. Here is my threading class (note: I haven't implemented looping yet, but it

Embedding matplotlib FuncAnimation in wxPython: Unwanted figure pop-up

你。 提交于 2019-12-14 04:03:48
问题 I have tried to modify the following example for a live plot. Embedding a matplotlib figure inside a WxPython panel I am trying to read the serial data coming from Arduino and plot/update the collected data. The problem is that the figure comes up before the wx App and I need to close the figure in order to see the wx App. I believe that the problem is related with the following lines but I don't know why. self.figure = plt.figure(figsize=(20,20)) self.ax = plt.axes(xlim=(0, 1000), ylim=(0,

Display image in wx.GridBagSizer

拈花ヽ惹草 提交于 2019-12-14 03:59:26
问题 I am trying to display an image on a wx.GridBagSizer The image is being read and I can see it if I comment out the sizerMain.Add lines, but it will not show in the sizer. Interestingly the space is reserved for it in the sizer. Can anyone please help? import wx class MainWindow(wx.Frame): def __init__(self,parent,id,title): wx.Frame.__init__(self,parent, wx.ID_ANY, title, size = (1200,600), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) sizerMain = wx.GridBagSizer(3, 2) self

wxpython: Transparent panel in wxpython

ぃ、小莉子 提交于 2019-12-14 03:57:46
问题 It is possible to make the whole frame transparent using SetTransparent(val) in wxpython. But can I make a single panel in it to be transparent? I tried using panelobj.SetTransparent(val) but that didnt work. import wx class MyFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title,size=(250, 250)) topPanel = wx.Panel(self) panel1 = wx.Panel(topPanel, -1) panel1.SetTransparent(100) panel2 = wx.Panel(topPanel, -1) panel2.SetBackgroundColour('gray')

DLL load failure error in wxPython

混江龙づ霸主 提交于 2019-12-14 03:29:15
问题 This is my first time using wxPython Python can go theatre my code import wx app=wx.App() win=wx.Frame(None, -1, 'Window Title') win.Show() app.MainLoop() This is the Error i'm getting: Traceback (most recent call last): File "C:/Users/sancios/Desktop/huluhup", line 1, in <module> import wx File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\__init__.py", line 45, in <module> from wx._core import * File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_core.py", line 4, in <module> import _core_

how to stop growing width of window when child sizers width increased in wx.Dialog in wxpython

人盡茶涼 提交于 2019-12-14 03:22:05
问题 I am very new to wxpython and wxwidgets.I have the code for wx.Dialog like below. def __init__(self, parent, Name, Platform): wx.Dialog.__init__(self, parent, -1, 'Launch Dialog', size=(-1,-1), pos=(-1,-1)) ###some code self.createSizers() self.Fit() def createSizers() self.mainSizer = wx.BoxSizer(wx.VERTICAL) SelectionSizer = wx.StaticBoxSizer(self.staticBoxTestSelection, wx.VERTICAL) self.horzDetailsSizer = wx.BoxSizer(wx.HORIZONTAL) self.DetailsSizer = wx.BoxSizer(wx.VERTICAL) ### add func

wxPython: This program needs access to the screen

旧巷老猫 提交于 2019-12-14 02:14:19
问题 I'm trying to use the Python GUI wx (installable via pip install wxPython ) in the following minimal app: import wx app = wx.App() Running this snippet returns the following: This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display of your Mac. Does anyone know how to help wx gain "access to the screen", or what a "Framework build of Python" is? I'd be grateful for any help others can offer with these questions!