Internet Data Handling » mailbox

andy not at available.local
Sun Oct 23 03:33:55 EDT 2016


Sat, 22 Oct 2016 19:41:45 -0400 wrote Adam Jensen:

> On 10/22/2016 05:47 AM, andy wrote:
>> I would type: help(mailbox) after importing it.
> 
> I guess the output of that might be more meaningful once I understand
> the underlying structures and conventions.

yes - you are right. fortunatelly python autors have thought about 
'documntation strings' and 'coding style', the syntax of python itself 
helps reading source code (indentation). this allows using auto-
documentation features like help(...).

when i don't know enough about a module like 'mailbox' , i first try a 
file search for the source code on the local system: i.e. 'locate 
mailbox.py' on a linux system. possibly i have to install the module 
first when there is nothing found (using pip or package manager).

this yields on my system ('sudo updatedb' - for updating the db) to this 
result:

/usr/lib/python2.7/mailbox.py
/usr/lib/python2.7/mailbox.pyc
/usr/lib/python3.5/mailbox.py

i can read the source file with: 'less /usr/lib/python3.5/mailbox.py'.
within the sourcefile i can study the imports and data structures.

Other sources of information: doc.python.org - even with search:
https://docs.python.org/3/search.html?q=mailbox

and finally all these mail-modules should follow the RFCs ;-)
https://tools.ietf.org/html/rfc2822

best regards
andy



More information about the Python-list mailing list