def get_cursor_offset(fd=1):
 csbi = get_console_screen_buffer_info(fd=fd)
 pos = csbi.dwCursorPosition
 size = csbi.dwSize
 return ((pos.Y * size.X) + pos.X)

def get_cursor_offset ( fd = 1 ) : csbi = get_console_screen_buffer_info ( fd = fd ) pos = csbi . dwCursorPosition size = csbi . dwSize return ( ( pos . Y * size . X ) + pos . X )
gets the current cursor position as a total offset value .