如何访问python类中函数返回的对象

2024-10-04 11:32:58 发布

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

我有以下python类:

class Example(QMainWindow):

   def onChanged(self, text):
   
     return text

   def buttonClicked(self):
   
     print(self.onChanged)

运行脚本时,我得到以下结果:

<bound method Example.onChanged of <__main__.Example object at 0x7fde1cab0550>>

我的问题是如何获取在onChanged函数中返回的文本内容

多谢各位


Tags: oftextself脚本returnmainexampledef