每当我尝试从WxPython中的组合框中返回字符串时,它都不会正确返回字符串,它返回的方式如下:
<bound method CommandEvent.GetString of <wx._core.CommandEvent; proxy of <Swig Object of type 'wxCommandEvent *' at 0x27e818> >>
我希望它返回输入到组合框中的字符串:
self.firmwarelist = wx.ComboBox(panel, pos=(170,22), choices=["6.61","6.61 N1000/Go","6.60","6.60 N1000/Go","6.35","6.35 N1000/Go","6.39","6.39 N1000/Go","6.20","6.10","6.10 N1000/Go","6.60","5.50","5.03","5.00","4.05","4.01","4.00","3.52","3.50","1.50"]
)
self.Bind(wx.EVT_COMBOBOX, self.e, self.firmwarelist)
这里是组合框返回的位置
def e(self,e):
global p
i = e.GetString
p = str(i)
print p
return p
一定是的
否则它不是函数调用。你知道吗
Edit:顺便说一下,将函数命名为参数是一个非常糟糕的主意。试着把一个e改成别的,例如f
相关问题 更多 >
编程相关推荐