먼저 라이브러리를 호출하고 기본적인 변수를 설정 한다.

(예 : 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)) 

 

전체 코드 ( 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