본인 ip 가져오기

dooh kim·2020년 8월 5일
0

본인 아이피 주소 받는 사이트

import urllib.request
from urllib.parse import urlparse

API = "https://api.ipify.org"
values = {
    "format": "json"
}

params = urllib.parse.urlencode(values)

URL = API + "?" + params

data = urllib.request.urlopen(URL).read()

text = data.decode('UTF-8')
print(text)
profile
testify to the light

0개의 댓글