Say I have a string that looks like this:
str = \"The &yquick &cbrown &bfox &Yjumps over the &ulazy dog\"
You\'ll notic
>>> a=[]
>>> str = "The &yquick &cbrown &bfox &Yjumps over the &ulazy dog"
>>> d={"&y":"\033[0;30m",
... "&c":"\033[0;31m",
... "&b":"\033[0;32m",
... "&Y":"\033[0;33m",
... "&u":"\033[0;34m"}
>>> for item in str.split():
... if item[:2] in d:
... a.append(d[item[:2]]+item[2:])
... else: a.append(item)
>>> print ' '.join(a)