wxpython

How do I layout a 3 pane window using wxPython?

早过忘川 提交于 2020-01-03 13:09:27
问题 I am trying to find a simple way to layout a 3 pane window using wxPython. I want to have a tree list in the left pane, then have a right pane that is split into two - with an edit component in the top part and a grid component in the bottom part. Something along the lines of: -------------------------------------- | | | | | Edit | | Tree | Control | | Control | | | |----------------------| | | | | | Grid | | | | -------------------------------------- I would like the window to be re-sizable

wxPython: Disable a notebook tab?

五迷三道 提交于 2020-01-03 11:37:09
问题 Is there anyway to disable a notebook tab? Like you can with the Widgets themselves? I have a long process I kick off, and while it should be pretty self-explanatory for those looking at it, I want to be able to prevent the user from mucking around in other tabs until the process it is running is complete. I couldn't seem to find anything in wx.Notebook to help with this? Code snippet: def __init__(self, parent): wx.Notebook.__init__(self, parent, id=wx.ID_ANY, style=wx.BK_DEFAULT) self

wxPython or pygame for a simple card game?

 ̄綄美尐妖づ 提交于 2020-01-03 08:41:41
问题 I have been playing around with writing some simple card games in Python for fun and I would like to add a graphical user interface (GUI) to the games. Which library would you recommend for writing the GUI for a simple card game? 回答1: If all you want is a GUI, wxPython should do the trick. If you're looking to add sound, controller input, and take it beyond a simple card game, then you may want to use pygame. 回答2: I haven't used wxPython, but Pygame by itself is rather low-level. It allows

Using GUI's in Python on an online IDE?

我只是一个虾纸丫 提交于 2020-01-03 08:41:16
问题 I have a question about running GUI's. I'm unfortunately running a Chrome OS, so that means I have no choice to use and run my code from an online IDE. I was wondering if it's at all possible to run a GUI package such as as Tkinter or wxWidgets from an online IDE? Any way at all? The main IDE I usually use is Cloud 9. 回答1: The answer to this is probably no. Packages like Tkinter and wxWidgets are written to interface on a lower level with the OS. Web interfaces such as Cloud9 wouldn't be able

How can I set Windows “DPI-scaling overrides” via a script?

ε祈祈猫儿з 提交于 2020-01-03 06:27:49
问题 We have a Python-based application with a WxPython GUI that we create for multiple operating systems. In Windows 10, at least in my environment (inside a VM on a high resolution monitor), the text elements in the interface are blurry. I can improve the appearance by setting the Windows application DPI-scaling override. However, the only way I have found so far is to do it manually from the Windows file explorer interface. My question: Is there a way to set this property from the command line

How can I set Windows “DPI-scaling overrides” via a script?

不问归期 提交于 2020-01-03 06:26:34
问题 We have a Python-based application with a WxPython GUI that we create for multiple operating systems. In Windows 10, at least in my environment (inside a VM on a high resolution monitor), the text elements in the interface are blurry. I can improve the appearance by setting the Windows application DPI-scaling override. However, the only way I have found so far is to do it manually from the Windows file explorer interface. My question: Is there a way to set this property from the command line

Unable to get arduino serial communication working in wxpython GUI

房东的猫 提交于 2020-01-03 05:37:06
问题 This is the definition which is used to update the labels in the GUI: def updateV(self, event): """""" global v ser = serial.Serial( port='COM3', baudrate=9600) x = ser.read() # read one byte ser.close() print x if v>3: self.labelOne.SetBackgroundColour('red') self.labelOne.SetLabel('Battery Voltage : ' + x) else: self.labelOne.SetBackgroundColour('white') self.labelOne.SetLabel('Battery Voltage : ' + str(v)) self.Refresh() This is the simple arduino code i have been using: int a; void setup(

Issue packaging scrapy spider with cx_Freeze or py2exe

拈花ヽ惹草 提交于 2020-01-03 05:34:08
问题 I've created a scraper with Scrapy and wxPython which works as expected, exporting a file with results to the desktop in CSV format. I'm attempting to package this into an executable with cx_Freeze using the below command prompt line: cxfreeze ItemStatusChecker.py --target-dir dist This seems to work fine, building the dist directory with ItemStatusChecker.exe However, when I open ItemStatusChecker.exe, I get the below error in the command prompt and my GUI does not launch: Traceback (most

is there an API for python to work with pressure-sensitive pen-tablets? (Mac OS, Linux)

浪尽此生 提交于 2020-01-03 05:14:12
问题 I want to write a cross-platform wxPython app, and I'm wondering if there a single API to work with pen-tablets on different platforms? I'm only interested to get pressure value and ereaser flag - but I couldn't fined anything cross-platform for python. UPD. so far, I found only windows-specific solution, what are the options for Mac OS and Linux? 回答1: https://bitbucket.org/AnomalousUnderdog/pythonmactabletlib A small Python library to allow Python scripts to access pen tablet input data in

How can I give variables to the event handler?

断了今生、忘了曾经 提交于 2020-01-03 03:55:06
问题 How can I give a variable to a function when I bind something? As a simple example: def test(self): self.MyTextCtrl.Bind(wx.EVT_TEXT, self.something, AnyVariable) def something(self, event, x) # do something print x As you see, I want to give the value "AnyVariable" to the function "something" so that it will be used as the "x". How can I do this? This example doesn't work. Edit: @ Paul McNett: Yeah, what I'm trying to do is more like: def test(self): self.MyTextCtrl1.Bind(wx.EVT_TEXT, self