#coding=utf-8import socketprint socket.gethostname() #获取主机名print socket.gethostbyname(socket.gethostname()) #获取IP地址try:print socket.gethostbyname('www.163.com') #获取远程地址IPexcept Exception, e:raise e客户端
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号