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'