My Tech Life

Memo by a Japanese Software Developer in his late 50s.

Entries from 2024-03-17 to 1 day

How to read .mbox files in Python (Improved Version)

As mentioned in a previous article, when you use the conventional python library method of fetching mailboxes, it seems that parsing the entire file is required, so it can take a considerable amount of time. import mailbox mbox = mailbox.m…

pythonで.mboxを読む(改善版)

通常のmailbox取得では、ファイルの全体をパース指定するようで、 とても時間がかかることは以前の記事に書いた。 import mailbox mbox = mailbox.mbox('example.mbox') for message in mbox: print("Subject:", message['subject']) mbox.close() 逐次的に…