POP3 Mail Download

Alex Martelli aleaxit at yahoo.com
Sat Mar 18 21:04:50 EST 2006


Kevin F <neurogasm at gmail.com> wrote:
   ...
> >          msgSize = int(split(msg, " ")[1]  # line is missing closing paren,
   ...
> thanks, that helped fix the syntax error, however, now when i run it, it
> gives me an error for 'split', saying "name 'split' is not defined"
> 
> i'm new to python so bear with me but how do i fix this?

you change the above-quoted assignment into:

    msgSize = int(msg.split()[1])

and similarly for other occurrences of split, which is a string method
(and needs to be called as such) and not a builtin function.


Alex



More information about the Python-list mailing list