python3服务器内部获取公网IP

from urllib.request import urlopen
import json
ip = json.load(urlopen('http://httpbin.org/ip'))['origin']
print(ip)

猜你喜欢

转载自blog.csdn.net/weixin_44784018/article/details/108705029