📜  获取IP地址python代码示例

📅  最后修改于: 2022-03-11 14:46:06.230000             🧑  作者: Mango

代码示例1
import socket    
hostname = socket.gethostname()    
IPAddr = socket.gethostbyname(hostname)    
print("Your Computer Name is:" + hostname)    
print("Your Computer IP Address is:" + IPAddr) 
#How to get the IP address of a client using socket