json文件的写入

时间:2025-03-28 16:58:56
# -*- coding: utf-8 -*- # @Time : 25/9/18 下午9:17 # @Author : # @File : json_dumps.py # @Software: PyCharm # @Mail : @ import json data={'id':1,'name':'51zxw','password':'66666'} print(type(data)) json_str=(data) print(type(json_str)) print(json_str) # 写入data文件 with open('','w') as f: (data,f) # 读取data文件 with open('','r') as f: data=(f) print(data)```