Skip to content

Instantly share code, notes, and snippets.

@kazeto
Last active February 28, 2018 03:57
Show Gist options
  • Save kazeto/da3463b54ddd04c7014c522da15300cb to your computer and use it in GitHub Desktop.
Save kazeto/da3463b54ddd04c7014c522da15300cb to your computer and use it in GitHub Desktop.
Python code which removes ANSI escape sequences in a string.
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