Kevin__Cao
2021-07-14 21:36
采纳率: 83.3%
浏览 94
已结题

python多线程代码报错

python多线程代码报错,个人觉得是没写参数,但不会改,请给出参数的修改代码

def handleCalc16(self):
    if self.timer3 is None:
        self.timer3 = QTimer()
        self.timer3.start(0.1)
        self.timer3.timeout.connect(self.handleCalc16)
    pp = pprint.PrettyPrinter(indent=4)
    with artdaq.Task() as task:
        task.ai_channels.add_ai_voltage_chan("Dev1/ai0")
        task.timing.cfg_samp_clk_timing(
            1000, sample_mode=AcquisitionType.CONTINUOUS, samps_per_chan=2)
        data = task.read(number_of_samples_per_channel=1)
        data = ','.join(str(i) for i in data)
        data = float(data) * 40
        self.ui.textBrowser_6.append('%.2f' % ((float('%.5f' % data)) ))
        self.ui.textBrowser_6.moveCursor(self.ui.textBrowser_6.textCursor().End)
thread = Thread(target=handleCalc16)
thread.start()

以下是报错信息
File "D:\PyCharm 2019.1.1\python3.7.9\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
TypeError: handleCalc16() missing 1 required positional argument: 'self'

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题