Termcap/terminfo for Python?

Oleg Broytmann phd at phd.pp.ru
Wed Oct 17 21:31:28 CEST 2001


On Wed, Oct 17, 2001 at 03:03:38PM -0400, Greg Ward wrote:
> Does anyone know if there exists an interface to termcap or terminfo for
> Python?

   curses.tigetflag
   curses.tigetnum
   curses.tigetstr

Example:

phd at phd 1 >> python
Python 2.1.1 (#1, Aug  8 2001, 19:17:29)
[GCC 2.95.2 20000220 (Debian GNU/Linux)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import curses
>>> curses.setupterm()
>>> curses.tigetstr("khome")
'\x1b[1~'

   I don't know which attributes describe width/height of a terminal.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.




More information about the Python-list mailing list