I am developing an application that will run a batch of a test when you press a Start Button on the GUI. The problem is that once that subprocess to run the test is called, the Python GUI freezes until the subprocess is finished executing. I am using Python 2.7 by the way.
I would like to interact with the GUI while the test is running, have different buttons that can be pressed, etc. without interrupting the test.
Here is an excerpt of what I have for this part:
import Tkinter
import tkMessageBox
import subprocess
top = Tkinter.Tk()
def batchStartCallBack():
tkMessageBox.showinfo("Batch Application", "Batch STARTED!")
for x in range(0, 3):
p = subprocess.call('batch path', stdout = None, stderr = None, shell=False)
def batchStopCallBack():
tkMessageBox.showinfo("Batch Application", "Batch Stopped!")
# STOP BATCH
StartButton = Tkinter.Button(top, text = "Start Batch", command = batchStartCallBack, width = 8, height = 2)
StopButton = Tkinter.Button(top, text = "Stop Batch", command = batchStopCallBack, width = 8, height = 2)
StartButton.pack()
StopButton.pack()
top.mainloop()