Skip to content

Instantly share code, notes, and snippets.

@jaseg
Created May 25, 2014 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaseg/61d98f55330d48706e71 to your computer and use it in GitHub Desktop.
Save jaseg/61d98f55330d48706e71 to your computer and use it in GitHub Desktop.
Rainbow terminal cursors
#!/usr/bin/env python
from colorsys import hsv_to_rgb
from time import sleep
from itertools import cycle
for i in cycle(range(100)):
print('\033]12;#{:02x}{:02x}{:02x}\007'.format(*map(lambda x: int(x*255), hsv_to_rgb(i/100, 1, 1))), end='', flush=True)
sleep(0.05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment