DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Simple Xmlrpc With Python

09.07.2005
| 1299 views |
  • submit to reddit
        code for the client :
from xmlrpclib import ServerProxy

print ServerProxy("http://127.0.0.1:9955").get_file()

code for the server :
import SimpleXMLRPCServer

def get_file():
    return "content"

server = SimpleXMLRPCServer.SimpleXMLRPCServer(("127.0.0.1", 9955))
server.register_function(get_file)
server.serve_forever()