import socket remote_host='www.baidu.com' try: print"IP address: %s" %socket.gethostbyname(remote_host) except socket.error,err_msg: print"%s %s:" %(remote_host , err_msg)
import socket remote_host='www.baidu.com' try: print"IP address: %s" %socket.gethostbyname(remote_host) except socket.error,err_msg: print"%s %s:" %(remote_host , err_msg)