Question about NNTPLib

Tim Wintle tim.wintle at teamrubber.com
Tue Jun 8 11:36:43 EDT 2010


On Tue, 2010-06-08 at 08:24 -0700, Anthony Papillion wrote:
> resp, count, first, last, name = server.group('comp.lang.python')
>     resp, items = server.xover(first, last)
> 
>     for subject in items:
>         resp, subject = server.xhdr('subject', first, last)
>         print subject
> 
> While the loop will indeed LOOP through all of the items, the print
> statement generates unprintable character (they look like [] in the
> terminal window.

"[]" is the way python prints an empty list.

I don't know NNTPLib, but I'm guessing you don't want to be throwing
away the subject variable, so you either want

for subject in items:
    print subject

or

for subject in items:
    resp, sub  = server.xhdr("subject", first, last)
    print sub

 - the second will do the same as your current code, I don't know how
NNTPLib returns the subject or what the list it's returning represents.




More information about the Python-list mailing list