如果參數只填寫一個會報錯:
self.t = Thread(target=function, args=("parameter1"))
Exception in thread Thread-1:
Traceback (most recent call last):
File "D:\python\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "D:\python\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
TypeError: function() takes 1 positional argument but 5 were given
當只有一個參數時需要加一個逗號
self.t = Thread(target=function, args=("parameter1"))
self.t = Thread(target=function, args=("parameter1",))-----correct