json文件导入
import json with open('jsonfile.json') as js:
js = json.load(open('jsonfile.json')) ss = json.load(js)
print(js) print(ss)
文件写入
import json
number = [1, 2, 3, 4, 5, 6]
filename = 'jsonfile.json'
with open(filename, 'w')as js:
json.dump(number,js)