beginner question

Cere Davis ceremona2000 at yahoo.com
Thu Dec 26 22:51:21 EST 2002


What's the deal with this?:

>>> for i in range(1,255):
...     st="122.97.71.%d" % (i,)
...     print gethostbyaddr(st)
...
Traceback (most recent call last):
  File "<stdin>", line 3, in ?
socket.herror: (1, 'Unknown host')

but when I type in:

>>>  print gethostbyaddr("122.97.71.5")
('some.host.edu', [], ['122.97.71.5'])


Does anyone know how I can get this simple for loop to work?

Thanks,
Cere



More information about the Python-list mailing list