I have a situation where I am running a Python script locally and using f = urllib.urlopen()
to query a server and pass some parameters. A PHP script on the server side accepts the parameters, checks them, and passes them to an executable using the passthru()
command. The executable runs, and then the output is passed back to the client, where it is read using response = f.read()
. The response is then printed.
This works, however the output is returned in one big block at the end of the process. What I would like to do is have the output from the online executable print in the python terminal locally as it runs. Does anyone know a good approach to take here? I've tried for line in f: print line
, but that gives the same behavior as before.