2024-05-13 00:32:32 发布
网友
我曾尝试将函数W_Kpower(scpi_comm)集成到一个类中,但遇到一个错误:
W_Kpower(scpi_comm)
keithley = rm.open_resource(instControl(inst_list)) NameError: global name 'self' is not defined
你能帮我把这个函数集成到一个类中吗。我需要在以后的其他课程中使用。我是初学者,所以我不了解我的代码的所有细节。在
此处的方法定义中缺少self:
self
def W_KPower(scpi_comm): # this should be def W_KPower(self, scpi_comm) return self.keithleyPower.write(":syst:loc")
我想在这里,你需要self.:
self.
此处的方法定义中缺少
self
:我想在这里,你需要
^{pr2}$self.
:相关问题 更多 >
编程相关推荐