I am getting a missing argument error and I am following the answer here.
Python: TypeError in Threading. function takes x positional argument but y were given
What am I missing? Help a newbie.
From answer
"each character is being passed as a separate argument to startSuggestworker.
Instead, you should provide args a tuple: t = threading.Thread(target=startSuggestworker, args = (start_keyword,)) "
self.thread = threading.Thread(target=self.threadManager(), args=(fl,))
TypeError: threadManager() missing 1 required positional argument: 'fl'
Here is the signature for threadManager()
def threadManager(self, fl):
#code
Edit Add more context: Some how this code works for me
self.thread2 = threading.Thread(target=self.startProcess2, args=(fl,myData))
And the definition for startProcess2
def startProcess2(self, fnfull, myData):
#code
But this fails for me
if fl != '':
self.threadx = threading.Thread(target=self.threadManager(), args=(self,fl,))
self.threadx.start()