Get the public IP from the python3 server

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

Guess you like

Origin blog.csdn.net/weixin_44784018/article/details/108705029