一、Python处理json文本格式
- 读取json数组,并遍历输出
with open(r'C:\oneTree.json', 'r',encoding='UTF-8') as f:
oneTreeDatas = json.load(f)#json列表
for oneTreeData in oneTreeDatas:#遍历输出
print(oneTreeData)
with open(r'C:\oneTree.json', 'r',encoding='UTF-8') as f:
oneTreeDatas = json.load(f)#json列表
for oneTreeData in oneTreeDatas:#遍历输出
print(oneTreeData)
本文标题:Python 文件处理
本文链接:https://www.haomeiwen.com/subject/xpmqmqtx.html
网友评论