By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,923 Members | 1,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,923 IT Pros & Developers. It's quick & easy.

curses -- getxy() error

P: n/a
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()

Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
shablool wrote:
Could someone please explain why stdscr.getxy() always raise an
exception:

[code here]
the method is named getyx(), this is old unix heritage.
see http://www.python.org/doc/2.0.1/lib/curses-window-objects.html

Jul 21 '05 #2

P: n/a
Thanks! (silly me)

k3****@gmail.com wrote:
shablool wrote:
Could someone please explain why stdscr.getxy() always raise an
exception:

[code here]
the method is named getyx(), this is old unix heritage.
see http://www.python.org/doc/2.0.1/lib/curses-window-objects.html


Jul 21 '05 #3

P: n/a
shablool wrote:
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
Jul 21 '05 #4

P: n/a
Peter Hansen wrote:
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. :)

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.