I am trying to create a thread within a function and am recieving an error
Here is my code:
from threading import Thread
def threadFunction(parameter):
print(parameter)
def main():
parameter = "abc"
t = Thread(target='threadFunction', args=(parameter, ))
t.start()
t.join()
main()
And am receiving the following error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\tom\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "C:\Users\tom\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
TypeError: 'str' object is not callable