[Tutor] curses
Alan Gauld
alan.gauld at btinternet.com
Fri Jul 13 08:22:08 CEST 2007
"max baseman" <dos.fool at gmail.com> wrote
> scr.sddch(1,0,population) # here is ware i think I'm having problems
> also would like this to be centered
Try this:
scr.addchr(max_x/2,max_y/2, str(population)[0])
> traceback (most recent call last):
> file "population.py", line 15, in <module>
> scr.addch(1,0,population)
> TypeError: argument 1 or 3 must be a ch or an int
You can pass the chr directly in which case the first arg is a char.
Or you can provide a position as you are doing in which case
the third arg must be a char. But populatio is an int so you need
to convert it. see above.
Alan G.
More information about the Tutor
mailing list