Skip to content Skip to sidebar Skip to footer

PyQt5 And Multiprocessing - Multiple Processes Create Multiple Windows Incorrectly

Trying to implement multiprocessing within a PyQt5 GUI framework to process multiple files in a parallel process, preferably in a QThread() background. Running the code below seems

Solution 1:

Guess what...

implement the following to build the GUI only once:

    import multiprocess as mp
    from PyQt5 import QtWidgets
    from QtWidgets import QMainWindow

    ... snippet ... your script code ...

    if __name__ == '__main__':

        app = QtWidgets.QApplication(sys.argv)
        window = MyApp()
        window.setGeometry(300, 100, 600, 600)   # adjustable (left,top,width,height)
        window.show()
        sys.exit(app.exec_())

... you probably figured this one out by now ;p


Post a Comment for "PyQt5 And Multiprocessing - Multiple Processes Create Multiple Windows Incorrectly"