Skip to content

Instantly share code, notes, and snippets.

@edsu
Created December 18, 2012 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edsu/4329253 to your computer and use it in GitHub Desktop.
Save edsu/4329253 to your computer and use it in GitHub Desktop.
example of reading the www-talk 1991-1994 mbox archive with python
#!/usr/bin/env python
# prints the subject lines for the www-talk 1991-1994 email archive
import os
import mailbox
os.system("wget http://dl.dropbox.com/u/2797650/www-talk_1991-1994.tar.gz")
os.system("tar xvfz www-talk_1991-1994.tar.gz")
for mbox_file in os.listdir("www-talk_1991-1994/data"):
for msg in mailbox.mbox("www-talk_1991-1994/data/" + mbox_file):
print msg["subject"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment