Another nntplib Question

Anthony Papillion papillion at gmail.com
Wed Jun 9 18:56:48 EDT 2010


Hello Everyone,

Thanks to help from this group, my statistical project is going very
well and I'm learning a LOT about Python as I go. I'm absolutely
falling in love with this language and I'm now thinking about using it
for nearly all my projects.

I've run into another snag with nntplib I'm hoping someone can help me
with. I'm trying to get a list of newsgroups from the server. The
documentation for the list() method tells me it returns a response
(string) and a list (tuple).

The list tuple contains the following: groupname, last, first, flag.
So, thinking I could access the group name in that list like this
ThisGroup = groupname[1].

Now, along those lines, I am wanting to retrieve some information
about each group in the list so I thought I could do this:

resp, groupinfo = server.list()
group = (info[1] for info in groupinfo)
resp, count, first, last, name = server.group(group)

But Python throws a TypeError and tells me I "can't concatenate str
and generator objects'.

What am I doing wrong? I've been banging my head on this for a few
hours and simply can't get it right. I've even googled for an example
and couldn't find one that showed how to deal with this.

Can anyone help?

Thanks in advance!
Anthony



More information about the Python-list mailing list