当前位置:主页 > 软件编程 > Python代码 >
时间:2021-07-07 08:51:45 | 栏目:Python代码 | 点击:次
在实际开发中经常需要对前端传递的多个参数进行不为空校验,可以使用python提供的all()函数
if not all([arg1, arg2, arg3]): # 当 arg1, arg2, arg3都不为空时all函数返回true return jsonify(errno=RET.PARAMERR, errmsg=u"参数不完整!")