Skip to content

Instantly share code, notes, and snippets.

@polikeiji
Last active August 29, 2015 14:09
Show Gist options
  • Save polikeiji/6e7889b104d12a35513d to your computer and use it in GitHub Desktop.
Save polikeiji/6e7889b104d12a35513d to your computer and use it in GitHub Desktop.
コンソールに上書き出力するPython用関数。
def override_print(message, line_length = 100):
if len(message) > line_length:
message = message[:line_length - 3] + "..."
sys.stdout.write((u"\r{0:<" + str(line_length) + "}").format(message))
sys.stdout.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment