ライブラリを呼び出して基本的な変数を設定します。

 

(例:jsonファイルが「file.json」の場合)

 

import json

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

 

インポートされたjsonデータ特定の数値データを取得する

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

 

すべてのコード

 

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