Basic getaddrinfo() list example : IP Address : Network PYTHON TUTORIALS


PYTHON TUTORIALS » Network » IP Address »

 

Basic getaddrinfo() list example


import sys, socket

result = socket.getaddrinfo("121.1.1.1", None, 0, socket.SOCK_STREAM)

counter = 0
for item in result:
    print "%-2d: %s" (counter, item[4])
    counter += 1



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Network
» IP Address