a python script which will parse an email message

chuck amadi chuck.amadi at ntlworld.com
Mon May 31 11:24:35 EDT 2004


(Please include python-list/comp.lang.python on your mails.  You'll get more
useful feedback.)

    chuck> Hi Skip used your snippet - the above returns a

    chuck> Returned mail: see transcript for details
    chuck> Returned mail: see transcript for details

Assuming those are the subjects of the messages in /var/spool/mail/chucka,
that looks fine.

    chuck> The second snippet - returns
    chuck> <open file '/tmp/subjects', mode 'w' at 0x3fcf0ea0> Returned mail: see 
    chuck> transcript for details
    chuck> <open file '/tmp/subjects', mode 'w' at 0x3fcf0ea0> Returned mail: see 
    chuck> transcript for details
    chuck> When i less /tmp/subjects theres no data.

What version of Python are you using?  Maybe it's so old it doesn't support
the 

    print >> openfile, ...

construct, though if not, I'd expect a SyntaxError.  Did you forget the
">>"?

Skip






More information about the Python-list mailing list