[Karrigell-main] Avoiding output buffering for pih-scripts
Brought to you by:
quentel
From: Dr. B. Z. <be...@sc...> - 2004-07-10 11:27:45
|
Hello to all, I am using Karrigell with a pih-script and I am calling an external command. As for example in apache with modpython the output from the os.system call seems to be send unbuffered to the browser, so that one can see what happens. In my Karrigell pih-script I tried different versions, but every time the output from the external command is send buffered, so that one have to wait until the external command is finished to see the result. Is there a way to get the output from the external command send unbuffered to the browser via Karrigell ? Below is the code: --- schnippp --- <% print "<PRE>" print result = commands.getstatusoutput(command + ziel) print result[1] print if result[0] == 0: # TEST1 #os.system(action + " " + option + " " + ziel) # TEST2 #result = commands.getoutput(action + " " + option + " " + ziel) # TEST3 result = os.popen(action + " " + option + " " + ziel, 'r', 0) for line in result: print line else: print "Check returns no result" print "</PRE>" %> --- snippp ---- Is there a simple solution, or is there perhaps a deeper modification in Karrigell needed ? If there are any hints, it would be great to get them. I hope that somebody has got an Idea :-) Regards, Bernd |