需求:从json文件中读取数据。
查阅资料后是使用这样的方法:
with open(file_path, "r") as f:
file_data = json.load(f)
原来也使用过json模块,但是对他的使用还不是很了解,说到底,还是要知根知底。
本文介绍了如何使用Python的json模块从json文件中读取数据,通过with语句和json.load方法实现数据的加载。
需求:从json文件中读取数据。
查阅资料后是使用这样的方法:
with open(file_path, "r") as f:
file_data = json.load(f)
原来也使用过json模块,但是对他的使用还不是很了解,说到底,还是要知根知底。
转载于:https://www.cnblogs.com/IDomyself/p/5308217.html

被折叠的 条评论
为什么被折叠?