[python] mailbox -- Question on usage

D

David Stockwell

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

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)

Then

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
mailbox?
So far I have only found one 'next()' that returns a message object.

Thanks in advance,

David
-------
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top