def get_console_mode(fd=1):
 mode = DWORD()
 hcon = STDHANDLES[fd]
 GetConsoleMode(hcon, byref(mode))
 return mode.value

def get_console_mode ( fd = 1 ) : mode = DWORD ( ) hcon = STDHANDLES [ fd ] GetConsoleMode ( hcon , byref ( mode ) ) return mode . value
get the mode of the active console input .