I want to update some information dynamically (just like a progress bar), I can do it with the following code
#! /usr/bin/env python import sys import time print "start the output" def loop(): i = 0 while 1: i += 1 output = "\rFirst_line%s..." % str(i) sys.stdout.write(output) sys.stdout.flush() time.sleep(1) loop()
It could only output single_line information dynamically. When it adds '\ n' to the output, it cannot work as you expect.
output = "\rFirst_line%s...\n" % str(i)
Any way to help him update multi-page content?
python
user1675167
source share