Answers for "python read json from url"

63

python read json file

import json

with open('path_to_file/person.json') as f:
  data = json.load(f)

print(data)
Posted by: Guest on April-08-2020
1

how to read a json resposnse from a link in python

import urllib, json

url = "put url here"
response = urllib.request.urlopen(url)
data = json.loads(response.read())
print (data)
Posted by: Guest on May-05-2020
1

fetch a json from url python

import requests
r = requests.get('url')
print r.json()
Posted by: Guest on May-05-2020
0

python read json from url

import urllib.request, json 
with urllib.request.urlopen("http://maps.googleapis.com/maps/api/geocode/json?address=google") as url:
    data = json.loads(url.read().decode())
    print(data)
Posted by: Guest on October-18-2021

Code answers related to "Dart"

Browse Popular Code Answers by Language