get the terminal's size
> My cs.tty module (on PyPI) has a ttysize function:
> which just parses the output of the stty command.
> If you don't want the cs.tty module, the ttysize code is just this:
> WinSize = namedtuple('WinSize', 'rows columns')
> def ttysize(fd):
> ''' Return a (rows, columns) tuple for the specified file
Fine, indeed ! I've installed cs.ttyy.
I just don't understand the reason why it takes "fd" as an argument.
I tried : P = Popen(['stty', '-a'], stdout=subprocess.PIPE,
universal_newlines=True) and it runs fine too, so the output seems not
really related to that fd.
Btw I did not know about namedtuple, thanks for that too.
> Hope this helps.