0
我想加入使用此代码2串:的Python:类型错误:“浮动”对象不是可调用
def __get_temp(self):
return float(self.ask('RS'))
def __set_temp(self, temp):
set = ('SS' + repr(temp))
stat = self.ask(set)
return self.check(stat)
temp = property(__get_temp, __set_temp)
一旦在一起,然后我在使用PyVisa串行总线发送的信号。然而,当我尝试调用函数,我得到
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
chil.temp(13)
TypeError: 'float' object is not callable
我试着四处寻找这个错误的解释,但他们没有任何意义。任何人都知道发生了什么事?
这条线: '设置=( 'SS' +再版(TEMP))' 将会给你带来痛苦......你覆盖了内置式。 (虽然它不是你的直接问题的原因。) – retracile 2009-12-07 15:39:15