Curses won't update screen - Solved!

C

Casey Bralla

My problem was caused by a getch() function which paused, waiting for the
character. Live and learn. <sigh>

For some reason, I can't get curses to refresh the screen. Can someone
offer a suggestion to try to debug this?

Here is my python code snippet:

stdscr=curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(1)
global screen
screen = stdscr.subwin(23, 79, 0, 0)
screen.border()

while 1 == 1:
        screen.addstr(5,5, str(time.localtime()))
        screen.refresh()

KeyPress = screen.getch()



When  run this, the local time is displayed ONCE, and then never changes.
Why isn't the screen.refresh() command refreshing the display?

I'm running a terminal session from within KDE, but I didn't think this
would matter.

Any ideas to suggest?
 

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,057
Latest member
KetoBeezACVGummies

Latest Threads

Top