Last active
February 28, 2018 03:57
-
-
Save kazeto/da3463b54ddd04c7014c522da15300cb to your computer and use it in GitHub Desktop.
Python code which removes ANSI escape sequences in a string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def remove_ansi_escape(s): | |
return re.sub(r'\033\[[0-9;]+m', '', s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment