[Python] _curses.error: add_wch() returned an error

Discussão em 'Python' iniciado por Stack, Agosto 1, 2025.

  1. Stack

    Stack Membro Participativo

    I have the following code rendering the display for my roguelike game. It includes rendering the map.

    def render_all(self):
    for y in range(self.height):
    for x in range(self.width):
    wall = self.map.lookup(x,y).blocked
    if wall:
    self.main.addch(y, x, "#")
    else:
    self.main.addch(y, x, ".")
    for thing in self.things:
    draw_thing(thing)


    It errors out every time. I think it's because it's going off the screen, but the height and width variables are coming from self.main.getmaxyx(), so it shouldn't do that, right? What am I missing? Python 3.4.3 running in Ubuntu 14.04 should that matter.

    Continue reading...

Compartilhe esta Página