# 코드
import threading, time
def proc(res):
print("start", res)
time.sleep(3)
print("end")
t = threading.Thread(target=proc, args=("abc"))
t.start()
# 결과
PS C:\project\unity\MyQuant\python> python3 .\pg.py
Exception in thread Thread-1 (proc):
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
TypeError: proc() takes 1 positional argument but 3 were given