[PySide] PyInstaller Main Window Duplicating Infinitely (Win 10)

paul basinger paulcb213 at gmail.com
Wed Sep 4 23:52:05 CEST 2019


Hello,

After making an exe from pyinstaller, the code below causes the main window
to duplicate repeatedly. I haven't tried it with QProcess yet but I started
looking into it. Anyone know python's multi-processes equivalent in
PySide2/QT. It runs fine when run normally with python (3.7).

Thanks,

Software Engineer
Paul Basinger
paulcb213 at gmail.com

import sys
import threading
import random
from PySide2.QtWidgets import QApplication, QLabel
from PySide2.QtCore import QThread
from multiprocessing import Process, Queue, Manager

def hello(q):
    q.put(1)

class AppThread(QThread):
    def __init__(self, parent):
        super(AppThread, self).__init__(parent)

    def run(self):
        self.loadApp()

    def loadApp(self):
        q = Queue()
        p = Process(target=hello, args=(q,))
        p.start()
        q.get(timeout=1)
        p.join()

if __name__ == "__main__":
    app = QApplication(sys.argv)
    label = QLabel("Hello World")
    label.show()
    thread = AppThread(app)
    thread.start()
    sys.exit(app.exec_())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20190904/1e77164c/attachment.html>


More information about the PySide mailing list