Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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)
@RDCH106

This comment has been minimized.

Copy link
Owner Author

RDCH106 commented Oct 5, 2016

Output Before:

ansi_win_before

Output After (applying Fix):

ansi_win_after

@RDCH106

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.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.