Pretty simple code:
import threading
def test(word):
print(word)
threading.Thread(target = test, args = "hello").start()
I get the following error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\phil\AppData\Local\Programs\Python\Python39\lib\threading.py", line 950, in _bootstrap_inner
self.run()
File "C:\Users\phil\AppData\Local\Programs\Python\Python39\lib\threading.py", line 888, in run
self._target(*self._args, **self._kwargs)
TypeError: test() takes 1 positional argument but 4 were given
The 4 given arguments are the number of letters in the word "hello". This is what I don't understand, since the word "hello" is only one argument. If i replace "hello" with "A", it works, because "A" is only one letter.
"hello"had 5 letters in it. Never mind. Did you mean:args = ("hello",)?