0

Total n00b to working with curses, and I'm a bit confused. I was able to follow demos up until I got to using windows, which seem to only work when they are inside of any kind of loop. However, in the below example each window has a little flickering cursor that leads me to think that I am doing something drastically wrong and refreshing like crazy when I really don't need to be.

import curses
from curses import wrapper


def main (stdscr):
    stdscr.clear()
    
    anastasia_win = curses.newwin(3, 20, 8, 0)
    mark_win = curses.newwin(3, 20, 16, 0)



    while True:
        anastasia_win.clear()
        anastasia_win.addstr(0,0,"1. Anastasia")
        anastasia_win.addstr(1,0,"Sensor status:")
        anastasia_win.addstr(2,0,"Position:")
        anastasia_win.refresh()

        mark_win.clear()
        mark_win.addstr(0,0,"2. Mark")
        mark_win.addstr(1,0,"Sensor status:")
        mark_win.addstr(2,0,"Position:")
        mark_win.refresh()

    stdscr.getch()


wrapper(main)

What do I need to change if (for now) I just want to draw that text and leave it on screen with no refreshing necesary? If I don't have the while loop, nothing gets drawn at all.

dongle
  • 599
  • 1
  • 4
  • 17
  • One of many duplicates: [curses library: why does getch() clear my screen?](https://stackoverflow.com/questions/19748685/curses-library-why-does-getch-clear-my-screen) – Thomas Dickey Mar 03 '23 at 08:48

0 Answers0