RF+Python 实战二: 常用方法
来源:互联网 发布:五知四会四个能力 编辑:程序博客网 时间:2024/05/21 10:55
自定义库里 ,定义函数 :outputInfoToFile
def outputInfoToFile(info, dir_or_file = None, mode = "w", is_record_time = "No"):
"""Output debug information to file"""
if not info:
return
this_moment = datetime.datetime.now()
format = "%Y-%m-%d %H:%M:%S"
full_path = getFullPath(name_or_path = dir_or_file, default_dir_name = "AutoTestLog", default_file_name = "detail.txt")
info = info + "\n"
if is_record_time.lower() == "no":
text = info
else:
text = this_moment.strftime(format) + " : " + info
with open(full_path, mode) as f:
f.write(text)
该函数可以应用到检测发送和返回数据的具体值 ,在固定路径下生成txt文件,查看想要获取的内容
阅读全文
0 0
- RF+Python 实战二: 常用方法
- RF+Python 实战一:登陆
- RF常用库及安装方法
- python与oracle(二)常用方法
- RF-常用关键字-log
- RF-常用关键字-Catenate
- RF-常用关键字-SEPARATOR
- RF-常用关键字-sleep
- RF与Python
- python学习(二)----字符串常用方法及注释
- Python爬虫实战(二)
- EWM RF 开发常用代码
- RF-常用关键字-set variable
- RF-常用关键字-Create List
- RF-常用关键字-get time
- RF-测试中常用函数
- RF+Python实现右键操作
- Python数据分析与挖掘实战(Pandas,Matplotlib常用方法)
- Python3.绘图基础matplotlib.pyplot
- 曹可爱之最可爱-Vue.js入门(七)列表渲染
- 有一个字符数组的内容为:"student a am i",请你将数组的内容改为"i am a student". 要求: 不能使用库函数。只能开辟有限个空间(空间个数和字符串的长度无关)。
- iOS程序猿之MAC生成SSH keys
- python3 正则模块 re.compile、re.match、re.search 方法
- RF+Python 实战二: 常用方法
- Nginx 域名转发
- Java的基础数据类型
- 设计模式学习一、命令模式
- 任务调度
- DBSCAN 密度聚类算法原理及伪代码
- Java和JS中的随机数生成办法
- HTML中常用的特殊字符实体编码(Character entity references in HTML 4)
- 从运维角度看中大型网站架构的演变之路