load json

# Python program to read
# json file
#https://www.geeksforgeeks.org/read-json-file-using-python/

import json


# JSON string
a = '{"name": "Bob", "languages": "English"}'

# deserializes into dict
# and returns dict.
y = json.loads(a)

print("JSON string = ", y)
print()



# JSON file
f = open ('instances_random_validation.json', "r")

# Reading from file
data = json.loads(f.read())

# Iterating through the json
# list
for i in data['images']:
        print(i)

# Closing file
f.close()

  

posted on 2021-05-14 15:50  cdekelon  阅读(66)  评论(0)    收藏  举报

导航