Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Allwin12
Created July 1, 2020 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Allwin12/94eea428a1310336f4be4fcbf0daa440 to your computer and use it in GitHub Desktop.
Save Allwin12/94eea428a1310336f4be4fcbf0daa440 to your computer and use it in GitHub Desktop.
from requests import get
import json
response = get("http://ipinfo.io/json")
data = json.loads(response.text)
longitude, latitude = data['loc'].split(',')
print(latitude, longitude)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment