Python中常用的操作Excel的三方包有xlrd,xlwt和openpyxl等,xlrd支持读取.xls和.xlsx格式的Excel文件,只支持读取,不支持写入。xlwt只支持写入.xls格式的文件,不支持读取。
openpyxl不支持.xls格式,但是支持.xlsx格式的读取写入,并且支持写入公式等。
原始数据文件apis.xlsx内容:
name | method | url | data | json | result |
---|---|---|---|---|---|
get接口 | get | https://httpbin.org/get?a=1&b=2 | |||
post表单接口 | post | https://httpbin.org/post | {name: Kevin,age:1} | ||
post-json接口 | post | https://httpbin.org/post</ |