On Sun, 12 Feb 2012 21:31:57 +0800
daedae11 <[email protected]> wrote:
> The code is:
> from nntplib import NNTP
> s = NNTP('news.gmane.org')
> resp, count, first, last, name = s.group
> ('gmane.comp.python.committers') print 'Group', name, 'has', count,
> 'articles, range', first, 'to', last resp, subs = s.xhdr('subject',
> first + '-' + last) for id, sub in subs[-10:]:
> print id, sub
> s.quit()
>
> When I write it into a script, it can execute normally. However, when
> I input it in interpreter line by line, I got the follow error when I
> execute the third sentence. What's the matter?
It seems that the connection is closed if you need more than about 6-7 seconds
(on my computer) to type the third line.
>From the source of "nntplib.py":
def getline(self):
"""Internal: return one line from the server, stripping CRLF.
Raise EOFError if the connection is closed."""
Bye, Andreas
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor