Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
Re: Escaping variable names
Jean-Michel Pichavant
3/5/2010 6:15:00 PM
Kamil Wasilewski wrote:
> Hi,
>
> Ive got an issue where a variable name needs to have a minus sign (-) in it.
>
> #Python 2.6
> from SOAPpy import WSDL
> wsdlFile = "
http://webapi.allegro.pl/uploader.php?...
> server = WSDL.Proxy(wsdlFile)
> server.soapproxy.config.argsOrdering = {'doGetCountries': ['country-code', 'webapi-key'] }
> server.doGetCountries(country-code=COUNTRYID}, webapi-key=WEBAPIKEY)
>
> The above method allows me to specify the order and name of variables being sent, but i have a problem since the variables have a "-" sign in the middle, is there a way to escape it in the variable name or get around the problem?
>
> Thanks!
>
>
def foo(*args, **kwargs):
print kwargs['country-code']
params = {'country-code': 'hello word'}
foo(**params)
JM
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Escaping variable names
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password