Analyse Python JSON
Analyser JSON - Convertir de JSON en Python
Si vous avez une chaîne JSON, vous pouvez l'analyser en utilisant la
json.loads()
méthode.
Le résultat sera un dictionnaire Python .
Exemple
Convertir de JSON en Python :
import json
# some JSON:
x = '{ "name":"John", "age":30, "city":"New
York"}'
# parse x:
y = json.loads(x)
# the result is a
Python dictionary:
print(y["age"])