Created
December 13, 2016 08:47
-
-
Save oyakata/0814772e26a9a24b0b2a5c773f1dcf21 to your computer and use it in GitHub Desktop.
シバンとANSIエスケープコードのサンプル
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
#!/usr/bin/python | |
from datetime import datetime | |
import time | |
import itertools | |
import sys | |
c = itertools.count() | |
out = sys.stdout | |
for x in c: | |
# "\033[31mFFF\033[0m" | |
out.write("\033[2K\033[G" + '{}> \033[31m{}\033[0m'.format(datetime.now().strftime('%Y-%m-%d %H:%M:%S'), x)) | |
out.flush() | |
time.sleep(0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment