摘要: import socket from binascii import hexlify #从二进制asscii导入十进制 iplist=["127.0.0.1","10.137.44.7"] for ip_addr in iplist: packed_ip=socket.inet_aton(ip_ad 阅读全文
posted @ 2025-02-22 21:56 guixiang 阅读(25) 评论(0) 推荐(0)
摘要: import socket remote_host ="www.guixiang.fun" print(socket.gethostbyname(remote_host)) import socket remote_host ="www.guixiang.funiii" try: print(soc 阅读全文
posted @ 2025-02-22 21:55 guixiang 阅读(11) 评论(0) 推荐(0)
摘要: #获取主机名 import socket hostname = socket.gethostname() print(hostname) ip_addr=socket.gethostbyname(hostname) print(ip_addr) 阅读全文
posted @ 2025-02-22 21:54 guixiang 阅读(20) 评论(0) 推荐(0)