wxpython

Adding a widget with a button - wxPython

廉价感情. 提交于 2019-12-13 05:19:00
问题 I'm trying to create something like the categories panel in Wordpress, with wxPython. What I'm trying to figure out, is how to add a widget when the user clicks a button (like "Add New Category") Here is my code: import wx class MainWindow(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(300,200)) self.panel = wx.Panel(self, -1) button = wx.Button(self.panel,-1,"Button") self.vbox = wx.BoxSizer(wx.VERTICAL) self.vbox.Add(button) add_btn = wx

Validating data in wxPython

ε祈祈猫儿з 提交于 2019-12-13 05:11:40
问题 I'm trying to create Validators for inputs on forms. I learned already that in wxPython it is necessary to inherit from wx.Validator due to lack of support for standard wxTextValidator and others. My question is: how effectively check that string complies to simple rules (no regexp please) acceptableChars = ['a', 'b', ...] all(char in acceptableChars for char in string) is something like this efficient? and how to cleanly specify all alphanumeric or digits? or maybe is there any ready class

how to combine wxPython, matplotlib and Pyopengl

╄→尐↘猪︶ㄣ 提交于 2019-12-13 05:08:31
问题 Hi so I currently have an application whereby I have a window displaying a matplotlib graph. i.e. such as this: from numpy import arange, sin, pi import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure import wx class CanvasPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) self.figure = Figure() self

wxPython ObjectListView Capture Ctrl-C shortcut

不羁岁月 提交于 2019-12-13 04:47:52
问题 I am having difficulty with my program written in Python 2.7.5 using wxPython 2.9.5, ObjectListView 1.2, lxml 2.3, and SQLAlchemy 0.8.2 and compiled into an exe with py2exe. The problem I am running into is after compiling the program into an exe I am no longer able to use Ctrl-C to copy data from the ObjectListView and paste it into other programs such as Excel, Notepad, or even Notepad++. This happens regardless of how many rows are selected to be copy/pasted. The results I get when pasting

Opening multiple windows from a list in WxPython

▼魔方 西西 提交于 2019-12-13 04:46:29
问题 I have a little program that goes to news aggregater's, gets the hrefs, and returns in a window. I want to have multiple windows open if multiple sites are choosen, right now, it will only go to the first one in a list, and completes perfectly. I assume I am not passing the the contents of the list properly to the next step in my program. import wx import urllib2 from BeautifulSoup import BeautifulSoup import re from pyparsing import makeHTMLTags, originalTextFor, SkipTo, Combine import wx

showing another window/frame in wxPython

≡放荡痞女 提交于 2019-12-13 04:46:17
问题 I am fairly new to programming and to python and wxpython. I have looked over this code for literally HOURS and I tried finding an answer everywhere online. I am having trouble getting a new window to show up after a menu item is clicked. Here is my code so far... import wx class MainWindow(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,'Python Test App',size=(600,400)) panel=wx.Panel(self) wx.Frame.CenterOnScreen(self) ##wx.Frame.Maximize(self) status=self

GUI freezes while charting with matplotlib

倖福魔咒の 提交于 2019-12-13 04:26:26
问题 I have a GUI written in wxPython (some extra information can be found in a different question). The GUI has indicators(charts, text, etc) and controls(buttons, radioboxes, etc. Every so often I get new data to plot. Depends on the size of that data set it can take up to 20 seconds to produce the graph and draw it. During this time the GUI controls are not responsive since the GUI thread is busy with charting. How do I make GUI controls always responsive regardless of what is the size of data

How can I get tab number of active tab in wxnotebook?

不问归期 提交于 2019-12-13 04:13:40
问题 I want to get the active tab index for the following code whenever tab is switched. Is there any built in function? import wx Creating notebooks: class PageOne(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) t = wx.StaticText(self, -1, "Histogram Plot", (20,20)) self.currentTab=1 class PageTwo(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) t = wx.StaticText(self, -1, "This is a PageTwo object", (40,40)) self.currentTab=2 class PageThree(wx.Panel)

Multiple key press detection wxPython

南笙酒味 提交于 2019-12-13 04:00:55
问题 I am creating a Project Manager using wxPython it has a splitter window. On one side is a tree that shows the names of and opens the files and on the other size is a textctrl that is used to edit the file. One problem I am having is that I would like it to go back 4 spaces when SHIFT and TAB are pressed, I have code working that add's 4 spaces when TAB is pressed. I am also have a problem that when I add a file that is in a different folder to my programs cwd the tree adds a new node and the

How can I put two values in one index of list to store it in excel file on row + cellvalue?

[亡魂溺海] 提交于 2019-12-13 03:56:25
问题 I want to add two values in one index of list like ['18' 'PASS','19' 'FAIL','20' 'PASS','21' '' FAIL] and then put this value in excel sheet like 18th row put value 'PASS'. 回答1: If you want to have multiple values in "one index of a list" you can simply use a list of tuples: myTupleList= [(1,"one"),(2,"two"),(3,"three")] If you want to store something as excel table (which is in and of itself 2 dimensional), you would need at least 3 things: myData = [(row_1,column_1,data_1), ..., (row_n,col