16 lines
433 B
Python
Executable file
16 lines
433 B
Python
Executable file
#!/usr/bin/python
|
|
import random
|
|
import sys
|
|
import commands
|
|
colors = ["red", "green", "yellow", "blue", "magenta", "cyan", "white"]
|
|
for line in sys.stdin:
|
|
echostring = ""
|
|
line = line.rstrip();
|
|
for x in line:
|
|
if x == '\\':
|
|
x = '\\\\'
|
|
colorname = colors[random.randint(0,6)]
|
|
echostring += "$(color lt" + colorname +")" + x
|
|
echostring += "$(color off)"
|
|
o = commands.getoutput('echo "' + echostring + '"')
|
|
print o.rstrip()
|