473,473 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

curses -- getxy() error

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
4 1872
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alex | last post by:
Hello all, I'm trying to learn Python, in particular the curses module. My system is running Slackware 9.0 and the verion of Python that comes installed with Slackware 9.0 is Python 2.2.2. ...
1
by: Edmond Ho | last post by:
Hi, I'm having trouble with a small curses program. I'm associate a pad with a panel. As I understand, a pad is supposed to be just a window with an arbitrary size. That seems to imply that a pad...
1
by: Riccardo Galli | last post by:
Hi, I'm writing some widgets in curses. Actually I'm trying to write a combobox. To do so, I need to create a pad inside a panel, so that I can hide/show it. I can't do it. I can create a...
0
by: mike.baranski | last post by:
So, can someone tell me why the following code is wrong? When you run it, it will place a . as you arrow key around the screen. Everything works, until you get to the bottom right corner of the...
1
by: Jerry Fleming | last post by:
Hi, I have wrote a game with python curses. The problem is that I want to confirm before quitting, while my implementation doesn't seem to work. Anyone can help me? #!/usr/bin/python # #...
0
by: skip | last post by:
Environment: Solaris 10, Python 2.4.2. I'm trying to convert a very simple (display-wise) program to use curses. This is my first try at using curses. I have wrapped my main: try:...
0
by: skip | last post by:
I have a fairly simple curses app which is giving me this error: addstr() returned ERR I'm trapping it and continuing. I can see that *some* of my addstring calls succeed. This one happens...
5
by: 7stud | last post by:
I can't see to get any y, x coordinates to work with curses. Here is an example: import curses def my_program(screen): while True: ch = screen.getch() if ch == ord("q"): break
1
by: Clay Hobbs | last post by:
I am making a text-based game similar to Zork with Python. I have decided to use the curses module, and have run into a problem. I want to scroll the commands and output up after a command is run...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.