python - What is the difference between json.load() and json.loads() functions - Stack Overflow

PHOTO EMBED

Tue Nov 17 2020 19:29:44 GMT+0000 (Coordinated Universal Time)

Saved by @arielvol #python

# open a json file for reading and print content using json.load
with open("/xyz/json_data.json", "r") as content:
  print(json.load(content))

# If we want to use json.loads():

with open("json_data.json", "r") as content:
  print(json.loads(content.read()))
content_copyCOPY

https://stackoverflow.com/questions/39719689/what-is-the-difference-between-json-load-and-json-loads-functions