Please help with python and "curses"!

Cliff Wells logiplexsoftware at earthlink.net
Mon Jan 28 15:19:39 EST 2002


On 28 Jan 2002 12:06:15 -0800
Antaeus Feldspar wrote:

> I've only recently started working with the curses module, which was
> installed for me along with Python 1.5.2 .  I have two tutorials that
> I've been reading from, but both of them have been advising me to use
> functions that don't appear to work.  The following Python script should
> indicate two places I'm having trouble:
> 

[snip code example]

> 
> Note the commented-out "start_color()" line.  This is listed in the
> tutorial at http://py-howto.sourceforge.net/curses/curses.html as a
> command I should use previous to calling "has_colors()" to find out if
> the terminal actually supports colors.  Yet the "start_color()" line by
> itself will terminate the script.  I have tried variations, such as
> curses.start_color() and stdscr.start_color() , to no avail.

This works under Python 2.1.1, but not under 1.5.2, AFAICT.

> The second major problem I'm having is that the other tutorial (
> http://www-106.ibm.com/developerworks/linux/library/l-python6.html )
> says that a curses.newwin command such as in the above line "secondwin =
> curses.newwin(10,10,2,1)" should create a new window that will appear
> above the window referred to by stdscr.  However, I can't get any such
> window to appear.

All seems to work under 2.1.1.  I get a nice big window with a thin border
around it.  Under 1.5.2 I get jack.  Maybe you should upgrade?

> Please help me figure out why curses seems to be working much
> differently for me than for everyone else?  =/

-- 
Cliff Wells
Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308
(800) 735-0555 x308

"Then with your new power you'll accomplish all sorts of cool stuff 
 in no time, and We'll All Be Sorry.  At that point you can either 
 gloat a bit, and then relent, or go ahead and send the robot army 
 after us." - Quinn Dunkan




More information about the Python-list mailing list