Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_result(url: str) -> dict:
- '''
- This function takes a URL and returns a Python dictionary representing the
- parsed JSON response.
- '''
- response = None
- try:
- response = urllib.request.urlopen(url)
- return json.load(response)
- finally:
- if response != None:
- response.close()
Advertisement
Add Comment
Please, Sign In to add comment