How can I remove the ANSI escape sequences from a string in python

Here is a snippet that includes my string. 'lsrnx1b[00mx1b[01;31mexamplefile.zipx1b[00mrnx1b[01;31m' The string was returned from an SSH command that I executed. I can’t use the string in its current state because it contains ANSI standardized escape sequences. How can I programmatically remove the escape sequences so that the only part of the string remaining is ‘examplefile.zip’. … Read more