read_json.py 578 Bytes
Newer Older
Ao Chen committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName:   test64
# FileName:      read_json.py
# Author:       lao_zhao
# Datetime:     2024/12/26 11:30
# Description:
# 
# ---------------------------------------------------------------------------
import json
from APIAutoTest_v3 import log_decorator


@log_decorator
def read_json(filepath):
    """读取json文件,将json文件的内容序列化为python对象,再返回"""
    with open(filepath, mode="r", encoding="utf-8") as f:
        return json.load(f)