Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# LGPLv2 yadda yadda yadda, do whatever, yadda yadda yadda, bum it in the gob, yadda yadda yadda
import bluetooth, datetime, optparse, time, os, user, pynotify, tempfile, twitter, sys
# Install required packages on Ubuntu:
# sudo aptitude install python-twitter python-notify python-bluetooth festival
# Set these values if you wish to use Twitter (you probably won't, but then I didn't really want too but it happended anyway)
@greenarrow
greenarrow / sigpipe.py
Created February 13, 2015 12:30
How to make Python play nicely with pipes
import sys
import errno
def main():
for i in range(20):
print i
if __name__ == "__main__":
# ensure buffer is flushed before we handle SIGPIPE
try: