I'am trying to do python app with combine tornado websocket and PyQt windows
I need to open PyQt window when I receive a message from websocket, but my program always fall down.
Is any elegant way how to do it?
Controller:
class MainWindow(QtWidgets.QWidget, widget.Ui_Form):
def __init__(self):
super(self.__class__, self).__init__()
self.setupUi(self)
self.message_window = None
class Message(QtWidgets.QWidget, message.Ui_Form):
def __init__(self, msg):
super(self.__class__, self).__init__()
self.setupUi(self, msg)
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
window.show()
s = Server(window)
s.start()
exit(app.exec_())
Server:
class Server(QtCore.QThread):
def __init__(self, main_window):
QtCore.QThread.__init__(self)
self.msg_win = main_window.message_window
def run(self):
self.msg_win = controller.Message("test")
self.msg_win.show()
*** starting tornado ***
Thanks for any help