def __init__(self): self.excel = operationExcel() self.operationJson = operationJson()
#!/usr/bin/python # -*- coding:utf-8 -*- #author:wanghailin """重写json文件的数据 动态参数处理: 1、搜索的请求数据不同,如“自动化测试”、“开发工程师”,面向对象化解决 """ from utils.operationJson import operationJson from utils.operationExcel import operationExcel import json from utils.public import * oj = operationJson() excel = operationExcel() def setso(kd=None): '''搜索关键字:给kd赋不同的值''' dic = json.loads(oj.getRequestData(row=2)) dic['kd'] = kd return dic def writepositionId(content): '''职位id写入文件''' with open(base_dir(filename="positionId"), 'w') as f: f.write(content)