Is it possible to multiprocess tkinter? Is it possible to multiprocess tkinter? tkinter tkinter

Is it possible to multiprocess tkinter?


It's possible, but all interaction with the GUI must be in a single process. Tkinter itself cannot span processes, nor threads. Your other processes must put work on a queue that the tkinter process periodically polls and acts upon (of course, you could also communicate with any other form of IPC).

The reason for this is that each root window is associated with an embedded tcl interpreter, and this interpreter itself cannot span processes.


The standard way to do this would be for all GUI manipulation to take place in a single process, while other processes will handle any computationally-heavy tasks. As long as there's no heavy computation going on in the GUI process, the application should remain responsive, and you can use cross-process communication to update the GUI with results of the heavy process as needed.