# -*- coding: utf-8 -*- import xlrd import json import xlwt import openpyxl from openpyxl import Workbook import requests import pdb import jsonpath jsonpathname=r"D:\python\JsonCheck\data.json" excelpath=r"D:\python\JsonCheck\excle.xlsx" sheetname=r"tab名字" jsondatapath="" checkcloum=2 NotExistList=[] def is_chinese(string): for ch in string: if u'\u4e00' <= ch <= u'\u9fff': return True return False def read_DataStru_json(path): with open(path, 'r', encoding='utf-8') as load_f: strF = load_f.read() if len(strF) > 0: datas = json.loads(strF) else: datas = {} return datas s=read_DataStru_json(jsonpathname) key="data" data = xlrd.open_workbook(excelpath,'rb') sheets=data.sheet_names() table = data.sheet_by_name(sheetname) initdic
python json字段必填字段与excle做比对
最新推荐文章于 2023-01-03 15:54:24 发布