POP3 Mail Download

Kevin F neurogasm at gmail.com
Sun Mar 19 01:24:21 CET 2006


Paul McGuire wrote:
> "Kevin F" <neurogasm at gmail.com> wrote in message
> news:dvi1a5$clpb$1 at netnews.upenn.edu...
>> Dennis Lee Bieber wrote:
>>> On Sat, 18 Mar 2006 16:44:44 -0500, Kevin F <neurogasm at gmail.com>
>>> declaimed the following in comp.lang.python:
>>>
>>>
>>>> However, if I try to actually download the messages themselves, my
>>>> python editor highlights 'msgSize' and says "invalid syntax" when I run
>>>> the following subsequent lines of code:
>>>>
>>>>
>>>> ------------------------
>>>> emails = []
>>>> for msg in messagesInfo:
>>>>           msgNum = int(split(msg, " ")[0]
>>>>          msgSize = int(split(msg, " ")[1]
>>>>          if(msgSize < 20000):
>>>>              messages = server.retr(msgNum)[1]
>>>>              messages = join(message, "\n")
>>>>              emails.append(message)
>>> Look very closely at your indentation
>>>
>>>
>> I fixed the indentation to:
>>
>> emails = []
>> for msg in messagesInfo:
>>          msgNum = int(split(msg, " ")[0]
>>          msgSize = int(split(msg, " ")[1]
>>              if(msgSize < 20000):
>>                  messages = server.retr(msgNum)[1]
>>                  messages = join(message, "\n")
>>                  emails.append(message)
>>
>>
>> and it still doesn't work, what's wrong?
> 
> See comments.
> -- Paul
> 
> 
> emails = []
> for msg in messagesInfo:
>          msgNum = int(split(msg, " ")[0]  # line is missing closing paren
>          msgSize = int(split(msg, " ")[1]  # line is missing closing paren,
> too
>              if(msgSize < 20000):              # this line should not be
> further indented
>                  messages = server.retr(msgNum)[1]
>                  messages = join(message, "\n")
>                  emails.append(message)
> 
> 
> 
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?



More information about the Python-list mailing list