Remove ASCI escap sequenc

result = "ls\r\n\x1b[00m\x1b[01;31mexamplefile.zip\x1b[00m\r\n\x1b[01;31m"
reaesc = re.compile(r'\x1b[^m]*m')
strip_result = reaesc.sub('', result)

你可能感兴趣的:(学习笔记)