My tkinter GUI (python 2.7) starts a subprocess that can run for quite a while and I use PIPE to send print statements to a text widget. It can run for a long time w/o any print statements and the GUI window says "Not responding" and I can do nothing in that window.
#lauch main
proc = subprocess.Popen(["python", testPath, filePath] + script_list,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=0)
#send the scripts output to the GUI text box
for line in iter(proc.stdout.readline,''):
text.insert(END, line)
#update in "real time"
text.see(END)
root.update()
text.update_idletasks()
Tried adding print
and flush
statements in the subprocess but that does not help.