📜  如何在python代码示例中获取用户ip

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

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