So i am running into a major issue. I am currently trying to use multi-processing/sub-processing to run files next to my Tkinter application, however, as soon as I run the process, the GUI freezes until I finish the process. Is there any way to get around this? I have also looked at other questions on SO but to no avail (I found one suggesting root.update() however that is not working as expected.
Note: I have not included GUI elements, as I have made basic programs to try this (only a couple of lines) and get the same problem. It also may be worth noting that I am running windows.
code (taken out of context):
def run_file(self):
self.root.update()
sub_process=subprocess.call(self.sub_proc_args)
process=multiprocessing.Process(target=self.run_file())
process.start()
I have found the problem (other then the target issue that BrenBarn pointed out). Here is my fix:
(i took out the multiprocessing.)
I have found that this is the fix because using call, when you execute it, it must return a return value, which makes Tkinter not continue its mainloop. This is fixed by using
Popen.