Last active
August 29, 2015 13:59
-
-
Save schmichael/10490771 to your computer and use it in GitHub Desktop.
This file contains 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/env python3 | |
hearts = "\u2661\u2665" | |
colors = list(map(str, range(30, 38))) | |
prefix = "\x1B[" | |
mid = "m" | |
def cycle(x): | |
while 1: | |
yield from x | |
try: | |
for heart, color in zip(cycle(hearts), cycle(colors)): | |
print(prefix + color + mid + heart, end='') | |
except KeyboardInterrupt: | |
print(prefix + mid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment