Internet Data Handling » mailbox

andy not at available.local
Sat Oct 22 05:47:41 EDT 2016


Fri, 21 Oct 2016 22:43:55 -0400 wrote Adam Jensen:

> The mailbox library documentation seems to be a little weak. In this
> example:
> 
> https://docs.python.org/2.7/library/mailbox.html#examples
> 
> import mailbox for message in mailbox.mbox('~/mbox'):
>     subject = message['subject']       # Could possibly be None.
>     if subject and 'python' in subject.lower():
>         print subject
> 
> What is the structure of "message"? I guess it's a dictionary but what
> is its structure? What are the keys? Is the structure constant or does
> it change depending upon the content of the mbox?
> 
> I'm a bit new to python documentation. How would a potential user of the
> "mailbox" library determine these things? Or did I miss something?

I would type: help(mailbox) after importing it.

best regards
andy



More information about the Python-list mailing list