WxPython组合框字符串未正确返回

2024-09-28 23:14:43 发布

您现在位置:Python中文网/ 问答频道 /正文

每当我尝试从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

Tags: of字符串coreselfgo方式wxpythonmethod