Created
January 9, 2021 08:44
-
-
Save mrrizal/bd8ca7caeda11cc1967d20d910ca57f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
class Hello(object): | |
def greeting(self, name): | |
return "Hello {}!".format(name) | |
def get_location(self): | |
ip_info_url = "https://ipinfo.io/json" | |
r = requests.get(ip_info_url) | |
if r.status_code == 200: | |
return r.status_code, r.json() | |
return r.status_code, {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment