Skip to content

Instantly share code, notes, and snippets.

@lordii
Created January 28, 2015 16:50
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 lordii/57dac361d849cbe2db45 to your computer and use it in GitHub Desktop.
Save lordii/57dac361d849cbe2db45 to your computer and use it in GitHub Desktop.
uname with randoms colors
#!/usr/bin/env python
from subprocess import Popen,PIPE
import random
colors = ("\033[31m", "\033[32m", "\033[33m", "\033[34m", "\033[35m",
"\033[36m" )
reset = "\033[0m"
if __name__ == '__main__':
p = Popen(["uname", "-rosmn"], stdout=PIPE)
out = p.stdout.read()
new = out.decode('utf-8')
for i in new.split():
print("".join([random.choice(colors),i,reset]),end=" ")
print(" ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment