beginner question

mongo57a at comcast.net mongo57a at comcast.net
Thu Dec 26 23:28:51 EST 2002


Works fine for me, as follows:

i=176
st='64.58.76.%d'%(i,)
print socket.gethostbyaddr(st)
ww7.dcx.yahoo.com

However, if I use the same code to ping myself, I get the same error that
you got. I'm on an Win32 machine.
I can execute:
print socket.gethostname()
'andy'
print socket.gethostbyname('andy')
'123.456.789.101'
But if I try:
print socket.gethostbyaddr('123.456.789.101')
socket.herror

What I can say is that it works the same way for both methods that you
identified. It is most likely that you are unable to resolve a host within
your loop. Check the specific IP where your loop fails and try that in
"single" mode. Should be OK.
Likewise, you should get an error using both methods as well (like I did).

HTH

Regards,

Andy


-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
   http://www.newsfeed.com       The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----



More information about the Python-list mailing list