ujson

import ujson

data = {"a": 1, "b": [1, 2, 3], "c": 3.14}

# 保存到文件
with open("output.json", "w", encoding="utf-8") as f:
    ujson.dump(data, f)

# 从文件读取
with open("output.json", "r", encoding="utf-8") as f:
    loaded = ujson.load(f)

print(loaded)
posted @ 2025-09-03 22:27  X1OO  阅读(5)  评论(0)    收藏  举报