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)
本文共 339 字,大约阅读时间需要 1 分钟。
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)
转载于:https://www.cnblogs.com/anglesheepbobo/p/7823581.html