首页 > 编程语言 > 详细

Python2 RF(3.0.4)与Python3 RF(3.1.2)区别

时间:2020-03-25 17:41:57      阅读:97      评论:0      收藏:0      [点我收藏+]

Note:3.1.2下面没有pybot了,替换成robot.写Case的文件,类型采用robot类型.Resource文件依旧可以使用txt

1,python3 下面不要使用<>.使用!=替换

Exit For Loop If    "${data.status_code}"!="200

2,request python3返回的content是byte类型,python2不是。所以需要用Decode Bytes To String这个方法转一下content

${content}    Decode Bytes To String    ${responseOfSameIds.content}    UTF-8
Run Keyword And Continue On Failure    should contain    ${content}    Duplicate key


3,python3没有split 可以使用Split String替代

${result}    Split String    ${pVersion}    .    1


4,python3没有find,用${findResult} Run Keyword And Return Status Should Contain ${executeResult} is running类似替换

${findResult}    Run Keyword And Return Status    Should Contain    ${executeResult}    sync-agent
Run Keyword If    ${findResult} == ${False}   Restart Probe


5,No keyword with name ‘Strip‘ found.用Strip String替代

${tmpLine}    Strip String    ${eachLine[0]}


6,No keyword with name ‘Replace‘ found.用Replace String替代

${rDate}    Replace String    ${tmpDate[0]}    _    ${SPACE}


7,For循环,不用添加":",结束用END

FOR    ${rtvfile}    IN    @{pRtvPrefixWithPath}
    ${prefix}    split string    ${rtvfile}    /
    append to list    ${rtvPrefixWithoutPath}    ${prefix[-1]}
END



Python2 RF(3.0.4)与Python3 RF(3.1.2)区别

原文:https://www.cnblogs.com/ting152/p/12567494.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!