def setwinsize(fd, rows_cols):
 (rows, cols) = rows_cols
 TIOCSWINSZ = getattr(termios, 'TIOCSWINSZ', (-2146929561))
 s = struct.pack('HHHH', rows, cols, 0, 0)
 fcntl.ioctl(fd, TIOCSWINSZ, s)

def setwinsize ( fd , rows_cols ) : ( rows , cols ) = rows_cols TIOCSWINSZ = getattr ( termios , 'TIOCSWINSZ' , ( - 2146929561 ) ) s = struct . pack ( 'HHHH' , rows , cols , 0 , 0 ) fcntl . ioctl ( fd , TIOCSWINSZ , s )
set the terminal size of a tty file descriptor .