Console column Width

Nathan Heagy gervaserules at yahoo.com
Tue Mar 13 21:00:45 EST 2001


I can't figure out how to learn the (linux) console's column width from
within a script? That is, without using curses.

I thought it would be so simple that an included module would already be
able to do it. I can't find one. I resorted to looking in the ls source and
found that a call to ioctl is how ls does it. However trying to use python's
fnctl.ioctl() on sys.stdout gives me an error. Even if it did work, I'm not
sure how to parse the results!

Any help here is greatly appreciated, especially replies be email : )

Thanks,

nathan





More information about the Python-list mailing list