Skip to content

Instantly share code, notes, and snippets.

@jovianlin
Created May 6, 2017 15:05
Show Gist options
  • Save jovianlin/1d5abde2dab7e53066edfff3ce80ec3d to your computer and use it in GitHub Desktop.
Save jovianlin/1d5abde2dab7e53066edfff3ce80ec3d to your computer and use it in GitHub Desktop.
Colourful Numbers with random, sys, time, and termcolor
import random, sys, time
from termcolor import colored
colors = ['grey', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', None]
generated = ''
sys.stdout.write(generated)
for i in range(100):
sys.stdout.write(colored('%02d ' % i, random.choice(colors)))
sys.stdout.flush()
time.sleep(0.05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment