Scapy-win's ANSI-color support breaks when you issue print or repr() commands on your own:
Welcome to Scapy (1.2.0.2-win)
>>> IP() # This works
<IP |> # 'IP' is printed in yellow
>>> repr(IP()) # This doesn't and shows ugly ANSI escape sequences:
'\x1b[0m<\x1b[0m\x1b[33m\x1b[1mIP\x1b[0m \x1b[0m|\x1b[0m\x1b[0m>\x1b[0m'
As a workaround, change the color theme to BasicTheme (which only prints plain ASCII without any ANSI color codes):
>>> conf.color_theme=BasicTheme()
>>> repr(IP())
'<IP |>' # 'IP' is printed as normal text/without color
Or print to the special console object which we currently use for ANSI color support:
>>> conf.color_theme=ColorOnBlackTheme()
>>> print >> console, repr(IP())
<IP |> # 'IP' is printed in yellow
All this is quite ugly and should be fixed.