Here is my code:
import mailbox
import pprint
mbox = mailbox.mbox('c:\documents and settings\student\desktop\mail\mailall.mbox')
for msg in mbox:
pprint.pprint(msg._headers)
This prints out hundreds of emails headers one after another. How can i write these results to a txt file?