def pread_console(fd, buffersize, offset, buf=None):
 (cols, rows) = os.get_terminal_size(fd=fd)
 x = (offset % cols)
 y = (offset // cols)
 return read_console_output_character(x=x, y=y, fd=fd, buf=buf, bufsize=buffersize, raw=True)

def pread_console ( fd , buffersize , offset , buf = None ) : ( cols , rows ) = os . get_terminal_size ( fd = fd ) x = ( offset % cols ) y = ( offset // cols ) return read_console_output_character ( x = x , y = y , fd = fd , buf = buf , bufsize = buffersize , raw = True )
this is a console-based implementation of os .