摘要: #1.3 保存最后N个元素 from collections import deque def search(lines,pattern,history=5): previous_lines=deque(maxlen=history) for line in lines: if pattern in 阅读全文
posted @ 2020-08-26 12:16 RoseLv 阅读(161) 评论(0) 推荐(0)
摘要: # 将九九乘法表写入文件# i控制行,j控制列,每完成一行就换行str1 = ''for i in range(1, 10): for j in range(1, i + 1): # print(f'{j}*{i}={i*j}', end=' ') str1 += f'{j}*{i}={i*j} ' 阅读全文
posted @ 2020-08-26 11:41 RoseLv 阅读(372) 评论(0) 推荐(0)
摘要: # _*_ coding: utf-8 _*_# __author__: slv# 2020/8/26import pytestimport os#此代码用例生成报告成功#注意:class以Test开头,method和function要以test开头或者结尾,测试文件也要以test开头或者结尾cla 阅读全文
posted @ 2020-08-26 11:30 RoseLv 阅读(216) 评论(0) 推荐(0)