Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ANSI Colors Fix for Python in Windows
import os
import platform
if == '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)

This comment has been minimized.

Copy link
Owner Author

commented Oct 5, 2016

Output Before:


Output After (applying Fix):



This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.