def with_color(string, fg, bg=49): print "\33[0m\33[%d;%dm%s\33[0m" % (fg, bg, string) return 0def B(string): print "\33[1m%s\33[22m" % string return 0#front colorRed = 1Green = 2Yellow = 3Blue = 4Magenta = 5Cyan = 6White = 7def fr(string): return with_color(string, Red+30) # Reddef fg(string): return with_color(string, Green+30) # Greendef fy(string): return with_color(string, Yellow+30) # Yellowdef fb(string): return with_color(string, Blue+30) # Bluedef fm(string): return with_color(string, Magenta+30) # Magentadef fc(string): return with_color(string, Cyan+30) # Cyandef fw(string): return with_color(string, White+30) # Whitefr("red")fy("yellow")fm("magenta")fg("green")fc("cyan")