POP3 Mail Download

Paul McGuire ptmcg at austin.rr._bogus_.com
Sat Mar 18 18:48:54 EST 2006


"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)






More information about the Python-list mailing list