![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
公共方法
石呆呆
这个作者很懒,什么都没留下…
展开
-
公共方法收集3:requests请求
上传文件接口 def upload(self,method, url, data, filepath, headers): if 'http' not in url: # 链接里没有服务器就拼接一下 url = self.host + url body = { "method": method, "params": str(data), # {} 如果又传参,一定要转原创 2021-06-15 20:02:28 · 97 阅读 · 0 评论 -
公共方法收集2:读写文件
实现目的 实现文件的读写 代码 1,使用openpyxl加载和编辑xlsx文件 def load_excel(path): ''' 加载excel ''' open_excel = openpyxl.load_workbook(path) return open_excel def excel_write_xlsx(row, cols, value, path): ''' 写入数据 ''' wb = load_excel(path)原创 2021-06-15 19:59:00 · 101 阅读 · 0 评论 -
公共方法收集1:json_compare
@[TOC]公共方法收集1:json_compare 实现目的 通过3个主要函数实现json数据格式的对比 思维导图 代码 # 比较两个Josn Node的类型 def compare_type(base, other): return type(base) is type(other) # 比较Json内容 def compare_json(base, other): msg = "" result = True if not compare_type(base, o原创 2021-06-09 14:39:55 · 377 阅读 · 0 评论