Skip to content

Instantly share code, notes, and snippets.

@RDCH106
Created October 5, 2016 10:06
Show Gist options
  • Save RDCH106/6562cc7136b30a5c59628501d87906f7 to your computer and use it in GitHub Desktop.
Save RDCH106/6562cc7136b30a5c59628501d87906f7 to your computer and use it in GitHub Desktop.
ANSI Colors Fix for Python in Windows
import os
import platform
if os.name == 'nt' and platform.release() == '10' and platform.version() >= '10.0.14393':
# Fix ANSI color in Windows 10 version 10.0.14393 (Windows Anniversary Update)
import ctypes
kernel32 = ctypes.windll.kernel32
kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment