SOAPpy-命名参数列表中的保留字 [英] SOAPpy - reserved word in named parameter list

查看:103
本文介绍了SOAPpy-命名参数列表中的保留字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SOAPpy访问SOAP Web服务.对该函数findPathwaysByText的调用工作得很好:

I'm using SOAPpy to access a SOAP Webservice. This call to the function findPathwaysByText works just fine:

server.findPathwaysByText (query= 'WP619', species = 'Mus musculus')

但是,此对函数登录名的调用不会:

However, this call to the function login does not:

server.login (user='amarillion', pass='*****')

由于pass是保留字,因此python不会运行它.有解决方法吗?

Because pass is a reserved word, python won't run this. Is there a workaround?

推荐答案

您可以尝试:

d = {'user':'amarillion', 'pass':'*****' }
server.login(**d)

这会传递给定的字典,就好像它们是关键字参数(**)

This passes in the given dictionary as though they were keyword arguments (the **)

这篇关于SOAPpy-命名参数列表中的保留字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆