read_json.py 626 Bytes
Newer Older
shenjiamin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName:   ${PROJECT_NAME}
# FileName:      ${FILE_NAME}
# Author:        shen
# Datetime:     ${DATE} ${TIME}
# Description:
#
# ---------------------------------------------------------------------------
import json

from APIAutoTest_shen_2 import log_decorator


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