def read_console_output_character(x=0, y=0, fd=1, buf=None, bufsize=1024, raw=False):
 hcon = STDHANDLES[fd]
 if (buf is None):
  if raw:
   buf = ctypes.c_char_p((' ' * bufsize))
  else:
   buf = ctypes.c_wchar_p((' ' * bufsize))
 coord = COORD(x, y)
 n = DWORD()
 if raw:
  ReadConsoleOutputCharacterA(hcon, buf, bufsize, coord, byref(n))
 else:
  ReadConsoleOutputCharacterW(hcon, buf, bufsize, coord, byref(n))
 return buf.value[:n.value]

def read_console_output_character ( x = 0 , y = 0 , fd = 1 , buf = None , bufsize = 1024 , raw = False ) : hcon = STDHANDLES [ fd ] if ( buf is None ) : if raw : buf = ctypes . c_char_p ( ( ' ' * bufsize ) ) else : buf = ctypes . c_wchar_p ( ( ' ' * bufsize ) ) coord = COORD ( x , y ) n = DWORD ( ) if raw : ReadConsoleOutputCharacterA ( hcon , buf , bufsize , coord , byref ( n ) ) else : ReadConsoleOutputCharacterW ( hcon , buf , bufsize , coord , byref ( n ) ) return buf . value [ : n . value ]
reads chracters from the console buffer .