python - Multithreading with pyqt - Can't get the separate threads running at the same time? -
I am trying to run a PyQT GUI above my Python application and I tried to split it into 2 threads The GUI will be liable, whereas my main lover goes, but I am unable to do it. Perhaps I have misunderstood it, what I have tried here is:
My window
and worker
thread is defined as:
It looks like follow very closely for online examples of my world
class is running a loop which once becomes infinite, when the user clicks "click" until it re Here is part of its definition.
class world (quathrade): def __init __ (self, original = none): QThread .__ init __ (self, guardian ) Self-Revolutionary = Incorrect // Snip def (Self): If it is running automatically: Self-Revolutionary Running = Wrong Other: Self. Running correctly = true self The method was the best stuff ()
edit: I have noticed that I am not actually using "my worker thread" How can I create a worker thread?
After looking at your code more closely, you have started MAIN_WORLD before QApplication, which That's what you do not want.
If you want to do something like this:
If __name__ == '__main__': app = QApplication (sys.argv) sys.exit (app.exec_ (),
And, in your window class:
square window (QWidget): def __init __ (auto, * args): self.world_thread = world ); # ...
The above main thread will allow Gui to control and allow worker threads to work in the background.
Comments
Post a Comment