Actually, XML-RPC is easier in Python than almost any other language, because the XML-RPC library uses a very cool feature of Python called “dynamic binding” to create a kind of virtual proxy that lets you call remote functions with exactly the same syntax as calling local functions.
import xmlrpclib
remoteServer = xmlrpclib.Server(”http://rpc.weblogs.com/RPC2″)
remoteServer.weblogUpdates.ping(SITE_NAME, SITE_URL)
This short example pings weblogs.com to tell it that your weblog has changed. I use this script to connect this Greymatter weblog to the weblogs.com community (since Greymatter has no weblogs.com support built in). But the point here is the syntax of that third line: it’s the same syntax as calling a local function. Once the proxy (remoteServer) is set up, the XML-RPC library makes the object act as if it has a weblogUpdates object within it and a ping method within that. It’s all a lie, of course; under the covers it’s constructing an XML-RPC request and sending it off, and then receiving an XML-RPC response and parsing it and returning a native Python object. But I, as a Python developer, don’t have to worry about all that if I don’t want to, and I don’t have to learn a new syntax for calling remote functions.

