【Python】由host得到IP 代码:import sockethost='www.163.com'ip=socket.gethostbyname(host)print('Ip of {} is {}'.format(host,ip))输出:C:\Users\horn1\Desktop\python\51-gethostip>python gethostip.pyIp of ww... Python 2023-09-01 117 点赞 1 评论 177 浏览