Problem running NNTP example from docs.
Remco Gerlich
scarblac-spamtrap at pino.selwerd.nl
Sat Apr 29 16:50:27 EDT 2000
Arcady Genkin wrote in comp.lang.python:
> I'm very new to Python, and was trying to run the example from
> documentation to nntplib library. I get an error when I try to
> instantiate NNTP object.
>
> ,----
> | >>> import nntplib
> | >>> s = NNTP('news')
> | Traceback (innermost last):
> | File "<stdin>", line 1, in ?
> | NameError: NNTP
> `----
>
> Could somebody point out what I am missing?
You have imported the module nttplib; to use the object NNTP within it, you
write nntlib.NNTP. Ie,
s = nntplib.NNTP('news')
(have never used that lib myself, but this is probably it)
--
Remco Gerlich, scarblac at pino.selwerd.nl
Hi! I'm a .sig virus! Join the fun and copy me into yours!
More information about the Python-list
mailing list