Paul McGuire wrote:
> "Kevin F" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Dennis Lee Bieber wrote:
>>> On Sat, 18 Mar 2006 16:44:44 -0500, Kevin F <[EMAIL PROTECTED]>
>>> 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?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to