I have the following code
print "Starting stage 1<br>"
# Something that takes about 5 seconds
time.sleep(5)
print "Stage 1 complete"
I view the script with my browser as it's part of a web-app, the problem is that it's displaying all of it together. I want it to display first the starting message before it starts and then add the completion message after it's complete.
What do I use to push information to the browser in this fashion?
Try flush the output after the first print using sys.stdout.flush()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With