import socket
import requests

# 获取本机计算机名称
hostname = socket.gethostname()
# 获取本机ip
ip = socket.gethostbyname(hostname)
print(ip)
ip = 'http://' + ip
res = requests.get(ip)
print(res)
'192.168.1.51'    '192.168.100.225'
