I have a multi-threaded application written in Python in which one thread \"takes care\" of the GUI, and the other is the worker thread. However, the worker thread has two m
The start method of QThread doesn't accept arguments. However, you've inherited QThread so you're free to customize it at will. So, to implement what you want, just pass arguments into the constructor of Worker.
Here's your code sample slightly modified to show this in action:
class Worker(QThread):
def __init__(self, do_create_data=True, parent=None):
super(QThread, self).__init__()
self.do_create_data = create_data
def run(self):
if self.create_data:
self.create_data()
else:
self.upload_data(), depends