Haikugen is a project mainly written in Python, it's free.
haiku generator script to win google nexus S phone
Usage:
./haikugen.py words.txt