why doesnt this work? -- full code here... http://pastebin.com/f940nPPg
....snip
f = open(log, 'r')
y = 3;
x = 3;
while True:
c = quote_window.getch()
if c == ord('r') or c == ord('R'):
quote_text_window.clear()
quote_text_window.refresh()
for line in f:
quote_text_window.addstr(line)
y = y + 1
quote_text_window.move(y, x)
elif c == ord('q') or c == ('Q'):
break
stdscr.noutrefresh()
quote_window.noutrefresh()
quote_text_window.noutrefresh()
curses.doupdate()
f.close()
....snip
i get error
quote_text_window.addstr(line)
_curses.error: addwstr() returned ERR
if i pass addstr() a string literal i get
quote_text_window.move(y, x)
_curses.error: wmove() returned ERR
i'm trying to develope a curses interface for reading log files. i'd like it to utilize ssh or something so i can read various log files from various computers in one interface. im' sure there are a ton of great programs that do this kind of thing but i thought it would be a good way to learn. i'm new to programming, python and curses (as you can probably tell)
Can you supply the entire code with comments included to explain certain parts you think might cause the problem? Anyways, how many lines is your log file? Because, if there are too many lines, it just doesn't run, like my terminal is 80 col and 24 lines, so if I had a log file that was 21 lines, the program doesn't work.