Skip to content

Instantly share code, notes, and snippets.

@phi-line
Created July 24, 2018 00:01
Show Gist options
  • Save phi-line/865a62b53c28aba2ada490b68d8932ef to your computer and use it in GitHub Desktop.
Save phi-line/865a62b53c28aba2ada490b68d8932ef to your computer and use it in GitHub Desktop.
def print_c(message):
"""
Clears last carriage returned line and writes a new one
:param message: (str)
:return: None
"""
sys.stdout.write('\x1b[2K')
sys.stdout.write(message)
sys.stdout.flush()
print_c(f"Hello!\r")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment