代码:
import socket host='www.163.com' ip=socket.gethostbyname(host) print('Ip of {} is {}'.format(host,ip))
输出:
C:Usershorn1Desktoppython51-gethostip>python gethostip.py Ip of www.163.com is 219.232.42.124
2018年5月15日