getting *term window dimensions w/o curses

Andrei Kulakov sill at optonline.net
Sat Aug 4 23:21:30 CEST 2001


Hello,

Is there some way to get aterm (and other terms) window dimension(s)
without curses? I tried (so far) commands.getoutput("echo $LINES") but
it doesn't return anything when used in a program, although it does
work from an interpreter.. what gives? I also tried this:

stdscr = curses.initscr()
self.height, self.width = stdscr.getmaxyx()
curses.endwin()

it *does* work but if I maximize the window and use the function that
runs these lines, the program stops accepting any further input.

I'd prefer to avoid putting the entire program in curses interface
if at all possible, because this is just the only thing I need and
I'm not very familiar with curses (and it looks rather complex).


-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: http://silmarill.org/cymbaline



More information about the Python-list mailing list