I'm trying to print a text file that contains ASCII art in python.
I realize the easy way would be do something like this
with open(image, 'r') as f:
for line in f:
print(line.rstrip())
but I want to print it using the curses library so that I can display other text along with the image. Here is what I've come up with so far.
lines=[]
with open('image.txt',"r",encoding="utf8") as f:
lines.append(f.readlines())
for a in lines:
char = str(("".join(a)))
stdscr.addstr(y, x, char)
This code does 90% of the job but I cant get the image to shift to the right. I can choose which row the image begins on by changing the y in stdscr.addstr(y, x, char) but changing x has no effect on which column it starts in.
Is there a way to fix this? Thanks.