I want to display a colored ascii art in a terminal (for e.g. windows cmd) using python-curses. I wrote something really basic like this :
import time
import curses
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(True)
f = open('betterdays.ansi.txt',"r",encoding="utf8")
asciiart = f.read()
for y, line in enumerate(asciiart.splitlines(), 2):
stdscr.addstr(y, 2, line)
stdscr.refresh()
time.sleep(5)
curses.echo()
curses.nocbreak()
stdscr.keypad(False)
curses.endwin()
whihc gives me the error:
stdscr.addstr(y, 2, line)
_curses.error: addwstr() returned ERR
I already looked at this question, but it doesn't solve my problem. Is there a better way to accomplish this? Any suggestions are greatly appreciated.
The .txt file can be seen/downloaded here.