On Thursday 17 August 2006 21:50, Yong Wang wrote: > I have written a python CGI script to run in html web page. When I > access to the html page, it only runs part of the script, then abort > because the late part of the script is involved in database access, it > is slow. I wonder whether there is a way to control html running speed > so that it can wait for CGI script to complete execution, then write the > results to html page ?
You could use output = '' output += 'Something else to print' instead of print 'Something else to print' And finally use print output Or to use that more efficiently use a list of strings and append to that list. That's probably faster than creating another immutable string time and again. And finally you just ' '.join(outputlist) and print that. Cheers Christoph -- http://mail.python.org/mailman/listinfo/python-list