I am working on a python based tkinter script, where the flow is like this:
A csh script can be run by specifying the script name and arguments on unix terminal.
A python script is written to take the script name and argument input from user (in GUI).
The python script then needs to execute the script on prompt from user( RUN button in GUI)
The code i am running is like this
def run():
os.system('./script_file')
it is able to execute the code… the only problem is: The control doesn’t switch back to python script after the execution is over. It just waits in the terminal.. or the cursor keeps on blinking in terminal as if still some execution going on( I am certain the execution is over)
Please suggest how To switch back the control.
I think using subprocess would be better here, it will allow you to control stdin stdout and stderr as well as return with an exit code that can be captured in python again.
http://docs.python.org/library/subprocess.html