I'm trying to launch a .py script from within a cgi script while running a local cgi server. The cgi script simply receives some data from Google Earth and passes it to the .py script which is currently being called using execfile('script.py') placed at the end of the cgi script.
The script runs to completion, however script.py contains some print statements that I need to be able to monitor while the process runs. Any errors in the .py print to the localhost console window and the print statements seem to be buffered.
Is there a way to send the output from the .py to another python console window while the localhost console is running?
It seems like the subprocess module should do what I need but I've only been able to send the output to a variable or a logfile. This is fine except that I need to see the print statements in real-time.
Thanks in advance