def get_cursor_position(fd=1):
 csbi = get_console_screen_buffer_info(fd=fd)
 coord = csbi.dwCursorPosition
 return (coord.X, coord.Y)

def get_cursor_position ( fd = 1 ) : csbi = get_console_screen_buffer_info ( fd = fd ) coord = csbi . dwCursorPosition return ( coord . X , coord . Y )
gets the current cursor position as an tuple .