Skip to content

Instantly share code, notes, and snippets.

@wcarhart
Last active June 21, 2021 14:49
Show Gist options
  • Save wcarhart/8c752a1f6c80d75ffaccca572fda6c9d to your computer and use it in GitHub Desktop.
Save wcarhart/8c752a1f6c80d75ffaccca572fda6c9d to your computer and use it in GitHub Desktop.
Python ANSI codes cheat sheet
# CURSOR
"\033[<N>A" # Move cursor up N lines (defaults to 1)
"\033[<N>B" # Move cursor down N lines (defaults to 1)
"\033[<N>C" # Move cursor right N lines (defaults to 1)
"\033[<N>D" # Move cursor left N lines (defaults to 1)
"\033[K" # Clear contents of line
# COLORS
"\033[90m" # light grey
"\033[91m" # red
"\033[92m" # green
"\033[93m" # yellow
"\033[94m" # blue
"\033[95m" # pink
"\033[96m" # teal
"\033[97m" # white
# STYLE
"\033[0m" # end coloring, return to default
"\033[1m" # bold
"\033[2m" # detail (dark grey)
"\033[3m" # default (white)
"\033[4m" # underline
"\033[5m" # flashing
"\033[7m" # black text, white highlight
"\033[8m" # black text, black highlight (hidden)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment