getting *term window dimensions w/o curses

Andrei Kulakov sill at optonline.net
Sun Aug 5 12:45:38 EDT 2001


On 05 Aug 2001 18:05:37 +0300, Erno Kuusela <erno-news at erno.iki.fi> wrote:
> In article <slrn9mqmjl.2rf.sill at sill.silmarill.org>,
> sill at optonline.net (Andrei Kulakov) writes:
> 
>| Anyway, this solution doesn't work in 2.1 - termios module doesn't
>| have this attribute, (TERMIOS is deprecated and doesn't have it either).
> 
> hmm, it works on my machine (debian, self built python 2.1):

Also Debian (woody), self-build 2.1:

>>> termios.TIOCGWINSZ
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  AttributeError: 'termios' module has no attribute 'TIOCGWINSZ'
>>> TERMIOS.TIOCGWINSZ
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  AttributeError: 'TERMIOS' module has no attribute 'TIOCGWINSZ'

Doh :/ What could be the problem? Anyone know?

> 
>>>> import TERMIOS      
> /usr/local/lib/python2.1/TERMIOS.py:7: DeprecationWarning: the TERMIOS module is deprecated; please use termios
>   DeprecationWarning)
>>>> TERMIOS.TIOCGWINSZ
> 21523
>>>> import termios
>>>> termios.TIOCGWINSZ
> 21523
> 
> 
>| What's tigetstr?
> 
> my guess is that it's a library function for accessing the terminfo
> database. i don't think python exposes it.
> 
>   -- erno


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



More information about the Python-list mailing list