[Tutor] curses

Alan Gauld alan.gauld at btinternet.com
Thu Jul 12 09:29:33 CEST 2007


"max ." <dos.fool at gmail.com> wrote

> hello all sorry but i just cant seem to get my head around curses

I know the feeling it took me a while too.

> iv read a few of the tuts out there and get what there saying
> but i cant write my own

Can you tell us
a) What OS are you using - Curses only really works on
Linux/Unix style systems in my experience.
b) Which particular curses tutorial did you read?
c) What you are trying to do
d) What code have you tried? And how does it fail?

Its a lot easier for us to address specific questions than to try
to write a generic introduction to curses.Especially when several
of those already exist. The thinghs you find hard to understand
might not be the same things I struggled with...

The key things to remember are to initialise the screen first
and restore it last:

import curses

# curses needs to initialize the screen
# so that it can control it. screen = curses.initscr()

# rest of program here...
# create viewports/windows etc# manipulate cursor, write 
text...curses.endwin()

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list