from pathlib import Pathfile_path = Path("aaa.json") # 实例化一个文件# 向文件写入内容file_path.write_text('{"id": "123", "name": "lqf", "sign_time": "2022-12-22T12:22:00", "friends": [1, 2, 3]}')