Created
November 9, 2018 14:51
-
-
Save enric1994/cbff27cefb90f28dfaf323ae00536700 to your computer and use it in GitHub Desktop.
Print stuff in Python 2.7 always in the same line using carriage return
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys,time | |
for i in xrange(100): | |
time.sleep(1) | |
sys.stdout.write('\r One line print! ' + str(i)) | |
sys.stdout.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment