Re: [Pyobjc-dev] Re: FYI: Open Source Scripting Layer For Cocoa
Brought to you by:
ronaldoussoren
From: Bob I. <bo...@re...> - 2003-06-12 23:21:32
|
On Thursday, Jun 12, 2003, at 15:59 America/New_York, Jack Jansen wrote: > > On woensdag, jun 11, 2003, at 20:13 Europe/Amsterdam, bb...@ma... > wrote: > >> On Wednesday, Jun 11, 2003, at 06:50 US/Eastern, Michael Hudson wrote: >>> Well, if none of the online currency exchange rate sites let you >>> scrape the going rate, you could always fake one that returns a >>> random >>> rate within some range and scrape that. Not as good as the Real >>> Thing, but it might do. >> >> See the demo services at..... >> >> http://xmethods.com/ >> >> .... as any of them could easily be wrapped by a Cocoa/Python app. > > Ah, brilliant! There's a currency converter in there. > > Now the problem has been replaced by a new one: does anyone here know > how to talk to a soap service from Python, and do we have all the > necessary tools available in a standard Python installation? Python does not come with any SOAP stuff. However, Twisted also does SOAP and there's also a couple blocking implementations at: http://pywebsvcs.sourceforge.net/ With SOAPpy (which I think bbum used, perhaps an earlier version) you would do something like this: >>> from SOAPpy import WSDL >>> proxy = WSDL.Proxy("http://www.xmethods.net/sd/2001/ CurrencyExchangeService.wsdl") # this blocks >>> print proxy.getRate(country1='us', country2='canada') # so does this 0.7414 -bob |