[python] mailbox -- Question on usage

David Stockwell winexpert at hotmail.com
Mon Jun 14 17:03:57 CEST 2004

After looking at http://docs.python.org/lib/module-mailbox.html  I am a bit 

The bottom of the page refers to some shortcut usage for getting a mail box

import email
import mailbox

mbox = mailbox.UnixMailbox(fp, email.message_from_file)

My question is what is fp?   and how come you don't have to say 
email.message_from_file(fileName) on the second parameter?

Is fp supposed to be something like this?

myname = 'mymailboxfilename'
fp = open(myname)


mbox = mailbox.UnixMailbox(fp, email.message_from_file(myname) )  ????

I tried executing the original statement in python (the one from the 
website) and it seemed to take it.

So what does it mean to specify the second parameter like that?
mbox = mailbox.UnixMailbox(fp, email.message_from_file)

Finally, where can I find a list of all the apis that I can call for 
So far I have only found one 'next()'  that returns a message object.

Thanks in advance,

Tracfone: http://cellphone.duneram.com/index.html
Cam: http://www.duneram.com/cam/index.html
Tax: http://www.duneram.com/index.html

Getting married? Find great tips, tools and the latest trends at MSN Life 
Events. http://lifeevents.msn.com/category.aspx?cid=married

More information about the Python-list mailing list