detect terminal width

Bruce Edge bedge at troikanetworks.com
Wed May 2 10:43:35 EDT 2001


[snip]

> env vars, then tigetstr("lines"), etc). def getheightwidth():
>     height, width = struct.unpack(
>         "hhhh", ioctl(0, TERMIOS.TIOCGWINSZ ,"\000"*8))[0:2]
>     return height, width

Thanks, I have one more question, where is TERMIOS.TIOCGWINSZ defined in
2.1?

-Bruce.



More information about the Python-list mailing list