方式1:

import sys

sys.stdout.write('\r' + '输出string')
sys.stdout.flush()

 

方式2:

print('\r' + '输出string', end='', flush=True)

相关文章: