[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [users] Re: random lines



also sprach Thomas J. Hamman (on Sun, 01 Jul 2001 11:58:32AM -0400):
> What exactly is this for?  You could use fortune and strfile.  Make the
> text file with a % symbol between each selection, like this:

a list of albums that i have on mp3 format.        and
the desire to have a script that plays albums randomly
  -- not a random song off any album,
     but a random album from beginning to end

the strfile method is plausible, but i'd much rather work with the
file that i have rather than autogenerate another one. and the file i
got doesn't have any %'s.

> That's what I do to get randomized quotes in my signature, so if that's
> the type of thing you have in mind, I recommend it.

that's the way i do that too.

> If you don't want to do it the fortune way, you could do it in about one
> line of Python after importing the random and linecache modules:
> 
> from random import *
> from linecache import *
> print getline('~/.muttrc',randrange(1,20))

except that hardcodes the file length, does it not?

martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:"; net@madduck
-- 
this site has moved.
we'd tell you where, but then
we'd have to delete you.



Reply to: