i originally did this as a wxbasicscript ("puppybasic") demo, using ansi codes for color "ascii" art. (ansi art.) i haven't used wxbasicscript in years, this version in python uses ansi codes too. i was originally of the impression that while idle (the standard python gui ide) does not display ansi, it will display curses screens. having tried idle, i can't seem to get it to do any kind of colored text... simply calling python as a script (the way i usually develop and test python scripts) would seem to be the best way to do either ansi or curses programs.
#!/usr/bin/env python
#public domain
q = " "
q = q + " **************** "
q = q + " ************************ "
q = q + " ************************** "
q = q + " ** ******************** ** "
q = q + " **** ******** **** "
q = q + " *** ` ****** ` *** Welcome to Puppy Linux! "
q = q + " *** ******** **** "
q = q + " ****************** "
q = q + " **************** "
q = q + " *****( ***** "
q = q + " ***( *** "
q = q + " ***( *** "
q = q + " ****** "
q = q + " "
c = 0
print chr(27) + "[1;37;40m"
for n in range (len(q)):
x = " 12345*`(".find(q[n])
if x < 0:
if c <> 0: print "\x08" + chr(27) + "[1;37;40m",
c = 0
elif x == 0:
if c <> 0: print "\x08" + chr(27) + "[1;30;40m",
c = 0
elif x == 6:
if c <> 6: print "\x08" + chr(27) + "[1;37;43m",
c = 6
elif x == 7 or x == 8:
if c <> 7: print "\x08" + chr(27) + "[1;37;47m",
c = 7
if x == -1: print "\x08" + chr(27) + "[1;37;40m",
if x != -1: print "\x08" + " ",
if x == -1: print "\x08" + q[n],
if float(n) / 58 == int(n / 58): print ""
print chr(27) + "[0;37;40m"
print ""