@staticmethod<EOL><INDENT>def from_windows_handle(std_handle):<DEDENT>
from ctypes import windll, c_ushort<EOL>handle = windll.kernel32.GetStdHandle(std_handle)<EOL>info = (c_ushort * <NUM_LIT:11>)() <EOL>if windll.kernel32.GetConsoleScreenBufferInfo(handle, info):<EOL><INDENT>return info[<NUM_LIT:7>] - info[<NUM_LIT:5>] + <NUM_LIT:1><EOL><DEDENT>
Use the Windows Console Handles API to get the console width,
where ``std_handle`` is the WINAPI ``GetStdHandle`` input
(e.g. STD_INPUT_HANDLE).

https://msdn.microsoft.com/library/windows/desktop/ms682075