#作者:Administrator
#时间:2019/10/19
from be.utils import public
import json
from be.utils import operationExcel
class operationJson:
def init(self):
self.excel=operationExcel.operationExcel()
#获取Json文件的内容
def getReadJson(self,f1):
with open(public.public().data_dir(data=“data”,filename=f1),encoding=“utf-8”) as f:
data=json.load(f)
return data
# 以excel表格中data列的值为键,获取在json文件中该键对应的值,f1表示json文件,f2表示excel文件
def get_json_data(self,row,f1,f2):
return json.dumps(self.getReadJson(f1)[self.excel.get_data_value(row,f2)])