wxpython

String problems with Python

泄露秘密 提交于 2019-12-12 03:47:55
问题 I am a Python noob so I may be missing something here, but I have a problem with how a string is handled inside my program. When I display it, only the first character is displayed. # some code MessageBox = ctypes.windll.user32.MessageBoxA # some other code testString = self.statusBar1.GetStatusText(0) # displays "azertyu" MessageBox(None, "azertyu", 'COUCOU', 0) # displays 'M' MessageBox(None, testString, 'COUCOU3', 0) # displays 'a' MessageBox(None, testString[1:], 'COUCOU3', 0) # #displays

wxpython: overlay wx.panel with another wx.panel but new panel doesn't resize right

别等时光非礼了梦想. 提交于 2019-12-12 03:46:10
问题 I've a frame with a splitter with 2 panels. one of these panels (right one = choosePanel) has a button which should open a new panel (infopanel) on the same place of the the choosepanel. I used this technique (wxPython: Good way to overlay a wx.Panel on an existing wx.Panel). This part works. But the infopanel doesn't resize right. When I add this panelhardcoded in the place of choosepanel, then it works. But when I use the overlay technique something happens. Code: class Main(wx.Frame): def

Why is my wx.App interfering with my matplotlib plots?

谁说胖子不能爱 提交于 2019-12-12 02:55:25
问题 I am trying to build a GUI with wxPython to control a pretty stable, well-established model. The standard output of the model includes a series of plots to screen done via matplotlib. These plots are all OK if the model is run from the command line. If I run from my new GUI, however, they all show up, but I have no control over them: I can't click their respective "save" buttons; if they get covered up by other windows, they are "grayed out" when the blocking window is moved away. Things like

wxPython wx.EVT_LIST_ITEM_SELECTED Not Working When Same Item is Clicked Twice in a Row

独自空忆成欢 提交于 2019-12-12 02:46:12
问题 I have the below code for a wxPython panel in which I am trying show the user all the states, but I only want them to be able to select (or check) either Massachusetts or New York. This works when the user clicks once on that state, as the wx.EVT_LIST_ITEM_SELECTED event is called, but if you keep clicking on the same state, this event is not called. It is only called again if the user clicks on a different state. I have tried using a wx.PyEvtHandler to capture the events and find out which

Way too slow wxPython application getting data from Google Spreadsheet and User input needs speed up solution

久未见 提交于 2019-12-12 02:25:43
问题 I want to make an application that reads out city names, road names, and distances between them from a Google Spreadsheet with several worksheets. So far I have the code bellow working right. It reads out from spreadsheet, receives input also from a user who wants to find out the road name (like Rode 60) between two cities and also the distance between them. However when I run the application it is incredibly SLOW. I think I have a server side-user side issue, but after reading tons of

wxpython - Multiple TextEntryDialog windows

女生的网名这么多〃 提交于 2019-12-12 02:20:07
问题 I'm trying to do a TextEntryDialog followed by another TextEntryDialog. I can only get the first one to appear and then after I hit ok a second one does not appear. I'm sure it's something easy, anyone have any suggestions? Thanks. #! /usr/bin/env python import wx class bucky(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,'Frame aka window', size=(300,200)) panel = wx.Panel(self) user = wx.TextEntryDialog(None, "Login", "Username", "") if user.ShowModal() == wx.ID

import error in wxPython: import wx.animate on windows7(64bit OS) with python3.5.1 in Anaconda 4.2.0(32bit)

独自空忆成欢 提交于 2019-12-12 02:17:40
问题 I am working on Windows7(64 bit OS) with Anaconda's python 3.5.1(32bit). I have installed wxPython for GUI. I keep getting the below import error ImportError: No module named 'wx.animate' import wx is working fine. import wx wx.version() gives '3.0.3.dev2752+8304ec1 msw (phoenix)'' I have installed wxPython from https://wxpython.org/Phoenix/snapshot-builds/ the version is, wxPython_Phoenix-3.0.3.dev2752+8304ec1-cp35-cp35m-win32.whl I have checked the path and don't see any problem there.. Can

wxpython won't draw rectangle on panel

情到浓时终转凉″ 提交于 2019-12-12 01:47:10
问题 I am trying to make chat client where I get the user input and display it on the white rectangle I am trying to draw. I try drawing the rectangle on the panel but I get this error Traceback (most recent call last): File "C:\Python27\client with gui.py", line 26, in <module> frame = WindowFrame(None, 'ChatClient') File "C:\Python27\client with gui.py", line 12, in __init__ self.panel.Bind(wx.EVT_PAINT, self.OnPaint) AttributeError: 'WindowFrame' object has no attribute 'panel' import socket

wx widget won't work (python)

孤街浪徒 提交于 2019-12-12 01:44:00
问题 I've written a script that should ask for two values and then display them in another window. It looks like this: import wx class Example(wx.Frame): def __init__(self, parent, title): super(Example, self).__init__(parent, title=title, size=(300, 200)) self.InitUI() self.Centre() self.Show() def InitUI(self): panel = wx.Panel(self) sizer = wx.GridBagSizer(4, 2) text1 = wx.StaticText(panel, label="Set COM-ports") sizer.Add(text1, pos=(0, 0), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=15) line = wx

Without exiting from the ssh_tunnel, open new terminal

好久不见. 提交于 2019-12-12 01:12:51
问题 I am using Python and wxpython for gui. I am trying to connect ssh tunnel. After connecting to ssh, wants a new terminal to open and have to continue my operation in local machine. How to achieve this? I tried subprocess, pexpect and paramiko, but all are capable to connect to ssh but not open the new teminal Below my code is there which I tried with pexpect: import time import sys import pexpect c = pexpect.spawn("ssh -Y -L xxxx:localhost:xxxx user @ host.com") time.sleep(0.1) c.expect("[pP