curses in Python 2.0?

Andrew Kuchling akuchlin at mems-exchange.org
Mon Nov 6 10:08:52 EST 2000


Erik Max Francis <max at alcyone.com> writes:
>   File "/usr/local/bin/cplay", line 197, in newwin
>     return curses.newwin(1, self.parent.cols, self.parent.rows-2, 0)
> error: curses function returned NULL

What are the values of self.parent.cols and self.parent.rows?  Perhaps
they're bogus values.  

> max at charmaine:~% python
> Python 2.0 (#3, Nov  5 2000, 11:15:21) 
> [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> import curses
> >>> curses.initscr()
> at which point the screen blanks and I get
> <curses window object at 0x818b4d8>

This behaviour is what I'd expect; curses has cleared the screen and
changed the console parameters to turn off keyboard echo.  Typing
curses.endwin() blindly should fix your terminal again.  

--amk





More information about the Python-list mailing list