I'm trying to get this snippet to work, but it seems it won't work in Windows. Under Linux it works just fine!
Here is the sample snippet of code demonstrating the usage:
tops = []
for ind, top in enumerate(lr.top):
color = colors.setdefault(top, COLORS[len(colors) % len(COLORS)])
if top in disconnected_tops:
top = '\033[1;4m' + top
if len(lr.loss_weight) > 0:
top = '{} * {}'.format(lr.loss_weight[ind], top)
tops.append('\033[{}m{}\033[0m'.format(color, top))
top_str = ', '.join(tops)
When the whole script is run, the escape character seems not to be working and weird characters show up on the screen. How do I get this to work on Windows?