how to run tkinter and also the pyqt5 in different processes
Jump to turn (12)
- 1how to run tkinter and also the pyqt5 in different processes
- 2what is the difference between process and thread, would the above share data in
- 3if we define some global data to be used for both how to do it
- 4how about modern opengl in tkinter and pyopengl
- 5this is not correct and nothing pops
- 6while(1): stdoutfileno.write('Hi' + '\n') stdoutfileno.flush() time.sleep(0.1)
- 7what is stdoutfileno and by write and flush, how the data is stored?
- 8please illustrate the file object
- 9if we dont close , is the data written to disk?
- 10can we do flush to force the data written to disk?
- 11what about for line in f:
- 12when the file is not closed, is the loop never ending?
- User
how to run tkinter and also the pyqt5 in different processes
- Assistant
To run tkinter and pyqt5 in different processes, you can use the Python multiprocessing module. Here is an example:
codeimport multiprocessing import tkinter as tk from PyQt5 import QtWidgets def tk_worker(): root = tk.Tk() # add your tkinter code here root.mainloop() def pyqt_worker(): app = QtWidgets.QApplication([]) # add your pyqt5 code here app.exec_() if __name__ == '__main__': tk_process = multiprocessing.Process(target=tk_worker) tk_process.start() pyqt_process = multiprocessing.Process(target=pyqt_worker) pyqt_process.start() tk_process.join() pyqt_process.join()