Rufen Sie zuerst die Bibliothek auf und legen Sie grundlegende Variablen fest.

(Beispiel: Wenn die JSON-Datei "file.json" lautet)

 

import json

with statement with open('file.json') as json_file: 
	json_dict = json.load(json_file)

Importierte JSON-Daten Ruft bestimmte numerische Daten ab

json_num = json_data["json_num"]
	print(str(json_num)) 

 

ALL code

 

import json

with statement with open('file.json') as json_file: 
	json_dict = json.load(json_file)

json_num = json_dict["json_num"]
    print(str(json_num)) 

+ Recent posts