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)
posted @ 2017-11-12 23:45  anglesheepbobo  阅读(1535)  评论(0编辑  收藏  举报