title: Display colored ascii art in terminal using Python curses
body: <p>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 :</p>
  <pre class="lang-py prettyprint-override"><code>import time
  import curses
  stdscr = curses.initscr()
  
  curses.noecho()
  curses.cbreak()
  stdscr.keypad(True)
  
  f = open('betterdays.ansi.txt',&quot;r&quot;,encoding=&quot;utf8&quot;)
  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()
  </code></pre>
  <p>whihc gives me the error:</p>
  <pre><code> stdscr.addstr(y, 2, line)
  _curses.error: addwstr() returned ERR
  
  </code></pre>
  <p>I already looked at <a href="https://stackoverflow.com/questions/18521909/python-curses-printing-ascii-art">this question</a>, but it doesn't solve my problem. Is there a better way to accomplish this? Any suggestions are greatly appreciated.</p>
  <p>The .txt file can be seen/downloaded <a href="https://gofile.io/d/xWfEpK" rel="nofollow noreferrer">here</a>.</p>