在Functions类中,我想访问Frame类的变量。如何访问其他类中的变量
请告诉我,如果有任何方法。
class Functions():
def changeText():
...
...
I want to change the 'text' in the Frame class
ex)Frame.text.SetFont('change text')
GUI元素
class Frame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, ....)
....
....
self.text = wx.StaticText(panel, .....)
你有没有尝试让变量全局? –
由于您的缩进而无法确定此属性是'text'对象属性('self.text')还是类属性? – cdarke