[Discuss] Yow

Daniel Barrett dbarrett at blazemonger.com
Sat May 21 13:05:24 EDT 2016


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



More information about the Discuss mailing list