Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet message from alt.ascii-art, 21 Jan 2003.
Re: music video in text

Re: music video in text

On Tue, 21 Jan 2003 09:45:06 +0000, Harry Mason wrote:


> F:P - either that or code one yourself. The file format is simple. I viewed
> the animation by setting an xterm to 160x84, loading the file in vim and
> holding Page Down.

Mm, I wrote it.

It's in Python and uses the curses module. It doesn't check the terminal
size, so make it big enough and set font to tiny.

Source code follows:

#!/usr/bin/python

import time, curses, sys

def show(screen, filename, pause):
    f = file(filename)
    done = 0
    while not done:
        # read the current frame
        row = 0
        while 1:
            line = f.readline().rstrip()
            if line == '': #EOF
                done = 1
                break
            if line == ',':
                break
            screen.addstr(row,0,line)
            row += 1
        #display the frame
        screen.refresh()
        #pause
        time.sleep(pause)

if len(sys.argv) not in (2,3):
    print "Usage: %s <filename> [pause in milliseconds]" % sys.argv[0]
    raise SystemExit
    
filename = sys.argv[1]
if len(sys.argv) == 3:
    pause = 1.0 / sys.argv[2]
else:
    pause = 0.042
screen = curses.initscr()
try:
    show(screen, filename, pause)
except KeyboardInterrupt:
    pass
curses.endwin()

###############END OF PYTHON CODE###############

Have fun!

Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f996b,fa2576db468ca602
X-Google-Attributes: gidf996b,public
X-Google-ArrivalTime: 2003-01-21 05:03:08 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!news-in.spamkiller.net!feed.newsfeeds.com!pd2nf1so.cg.shawcable.net!residential.shaw.ca!news2.calgary.shaw.ca.POSTED!not-for-mail
X-Trace-PostClient-IP: 24.78.145.92
From: "lament" <ayz...@shaw.NOSPAM.ca>
Subject: Re: music video in text
User-Agent: Pan/0.13.2 (I wwwondeling why alla boppah ferra pushing in?)
Message-ID: <pan...@shaw.NOSPAM.ca>
Newsgroups: alt.ascii-art
References: <6bd...@posting.google.com> <slrnb2phui.ku6.Faux_Pseudo@fugozi.cx1209071-a> <slr...@servalan.ecs.soton.ac.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Lines: 57
Date: Tue, 21 Jan 2003 13:03:02 GMT
NNTP-Posting-Host: 24.69.255.232
X-Complaints-To: abu...@shaw.ca
X-Trace: news2.calgary.shaw.ca 1043154182 24.69.255.232 (Tue, 21 Jan 2003 06:03:02 MST)
NNTP-Posting-Date: Tue, 21 Jan 2003 06:03:02 MST
Organization: Shaw Residential Internet
Xref: archiver1.google.com alt.ascii-art:21531
About this message. This message was posted publicly to the newsgroup alt.ascii-art in 2003 and is mirrored here unchanged as part of the Historic Archives – only email addresses are masked. The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can. Are you the author? Contact us to get your posts attributed, connected to your artist profile, or removed.

Report this message

Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.

Help classify this post