import socket

host_name = socket.gethostname()
ip = socket.gethostbyname(host_name)
print("本地IP地址是:" + ip)


 


如果觉得文章不错,可以分享给其他人哟~