[英]Writing JSON data to file in python
我不太确定如何编写JSON
所以请您帮我,我正在尝试使用python
JSON
实现此功能。 这是伪代码
binary_students = json(students)
write_to_the_file_system(binary_students)
我不太了解,有人可以帮我吗。
您可以使用字典来存储Json数据,如下所示:
>>> dict = {'Student1':'x1','Student2':'x2'}
然后使用json
库
>>> import json
>>> with open('data.txt', 'w') as outfile:
json.dump(dict,outfile)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.