python手机自动化框架_python自动化框架(一)

一、jsonpath难点分析

dic = {

"error_code": 0,

"stu_info": [

{

"id": 2057,

"name": "xiaohei",

"sex": "nan",

"age": 29,

"addr": "beijing",

"grade": "tianxie",

"phone": "18712321234",

"gold": 100

}

]

}

import jsonpath

s = jsonpath.jsonpath(dic,'$..error_code')

print(s)

# seqs=['!=','>=','<=','=','','in','notin']

# #list循环这种的话,写用例的时候简单

# s1='error_code=0,name!=xxx,age>18'

# #[error_code>=0 , name!=xxx,age>1]

# s1_list = s1.split(',')

# format_list=[]

# for s in s1_list:

# #erro_code=0 [error_code,0]

# #name!=xxx

# for seq in seqs:

# # = != >=

# if seq in s:

# key,value = s.split(seq)

# tmep = [key,seq,value]

# format_list.append(tmep)

# break

# #[[error_code,'=',0] ]

#

# print('format_list',format_list)

#s='erro_code:=:0,name:!=:xxx,age:>:18'

#这种写代码的时候简单

erro_code = 0

# error_code=0

# name!=xxx

# age>18

# < >= in <= notin

标签:code,name,框架,python,age,自动化,list,error,xxx

来源: https://www.cnblogs.com/mengmeng1011/p/10358494.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值