Skip to content

Instantly share code, notes, and snippets.

@xxiz
Last active December 25, 2022 01:30
Show Gist options
  • Save xxiz/bd5e0664d912ce933c3176dbe1dc2028 to your computer and use it in GitHub Desktop.
Save xxiz/bd5e0664d912ce933c3176dbe1dc2028 to your computer and use it in GitHub Desktop.
updating previous console output line via python
import time
print('a')
x = 0
while True:
print('\r', end='') # carriage return
print(x, end='') # define no new line on end
x=x+1
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment