1.
脚本是使用openpyxl 2.5.9开发的。在部署到server时报错:
Traceback (most recent call last):
File "Read_preConditions.py", line 206, in <module>
run(i)
File "Read_preConditions.py", line 187, in run
main(os.path.split(production_line[0])[1], production_line[1], dict_precond, production_line[2])
File "Read_preConditions.py", line 135, in main
Workbook_excel(result1, file, file_name, 'Not-Lab')
File "Read_preConditions.py", line 89, in Workbook_excel
sheet.cell(1, 1).value = tag_[0]
File "C:\Python37-32\lib\site-packages\openpyxl\worksheet\worksheet.py", line 296, in cell
coordinate = coordinate.upper().replace('$', '')
AttributeError: 'int' object has no attribute 'upper'
查询发现server上的openpyxl 版本是2.3.0. 在新版本中 worksheet.py 的 cell()方法已经做了更新。
所以这样写:sheet.cell(1, 1).value 也没事。但是在2.3.0中要这样写:heet.cell(row=1, column=1).value才行。
2.
catlog.py 通过os模块发送adb命令,抓取一些log,让后pull到本地。使用方法:catlog.py path。
同事拿去调用的时候,没有添加path参数,结果抓取的log覆盖了catlog.py脚本。还好有备份。
博客讲述了两个脚本相关问题。一是使用openpyxl 2.5.9开发的脚本部署到server报错,原因是server上openpyxl版本为2.3.0,cell()方法写法不同;二是catlog.py脚本通过os模块发adb命令抓log,同事调用时未加path参数,导致log覆盖脚本,好在有备份。

被折叠的 条评论
为什么被折叠?



