curses -- getxy() error

S

shablool

Hi,
Could someone please explain why stdscr.getxy() always raise an
exception:

import curses
import traceback

def init(stdscr):
x = y = 0
while 1:
c = stdscr.getch()
if c == ord('q'):
break
stdscr.addch(c)
(x, y) = stdscr.getxy()
stdscr.refresh()

def main():
try:
curses.wrapper(init)
except Exception, e:
traceback.print_exc()

if __name__ == "__main__":
main()
 
P

Peter Hansen

shablool said:
Hi,
Could someone please explain why stdscr.getxy() always raise an
exception:

If you post the exception traceback here (the whole thing, cut and
pasted from your terminal window), we can show you how to analyze it to
determine for yourself exactly what the problem is. This will help you
in the future, even if k33rni's answer solves your immediate problem...

-Peter
 
K

k33rni

Peter said:
post the exception traceback here[...], we can show you how to analyze it to
determine for yourself exactly what the problem is

true, remember that for the future. and that goes to everybody asking
questions here. thing is, I've done enough curses programming (in both
Python and C) to see this particular issue immediately, without the
need for a traceback. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,060
Latest member
BuyKetozenseACV

Latest Threads

Top