[Help]: mailbox classes
François Granger
fgranger at alussinan.org
Fri Sep 20 14:34:46 EDT 2002
François Granger <fgranger at alussinan.org> wrote:
> after some thought and some trial and errors, I came with this solution.
> I don't like it, it look bad.
>
> def main():
> fp = file(folderfile)
> folder = mailbox.UnixMailbox(fp, factory=email.message_from_file)
> while 1:
> mail = email.message_from_file(fp)
> print mail
> if not folder.next():
> break
> #mail = email.message_from_file(fp)
>
> if __name__ == '__main__':
> main()
After reading other posts on other matters, light came at least...
def main():
fp = file(folderfile)
folder = mailbox.UnixMailbox(fp, factory=email.message_from_file)
for message in folder:
print message
This works as expected, as usual in Python, the simple things _ARE_
simple, the complexe ones not difficult ;-).
Sorry for any inconvenience.
--
"On jouit moins de ce qu'on obtient que de ce qu'on espère."
- Jean-Jacques Rousseau
- Cité par Anne-Marie
More information about the Python-list
mailing list