Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month at the Massachusetts Institute of Technology, in Building E51.

BLU Discuss list archive


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

[Discuss] Yow



Years ago, GNU Emacs came with a C program called "yow" for printing
random quotes from Zippy The Pinhead. It employed a file called
"yow.lines" as a database of quotes, still available from:

  https://github.com/shentonfreude/dot-emacs/blob/master/yow.lines

This morning, I found myself missing "yow," so I reimplemented it in
Python.  Download the "yow.lines" file above, stick it in
/usr/local/etc, and you too can have random Zippy quotes on the
command line.

#!/usr/bin/python
import random
lines = open('/usr/local/etc/yow.lines', 'r').read().split('\000')
print lines[random.randint(1, len(lines)-1)].strip()

Enjoy.

--
Dan Barrett
dbarrett at blazemonger.com



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org