Never been to DZone Snippets before?

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

simple xmlrpc with python (See related posts)

code for the client :
   1  
   2  from xmlrpclib import ServerProxy
   3  
   4  print ServerProxy("http://127.0.0.1:9955").get_file()


code for the server :
   1  
   2  import SimpleXMLRPCServer
   3  
   4  def get_file():
   5      return "content"
   6  
   7  server = SimpleXMLRPCServer.SimpleXMLRPCServer(("127.0.0.1", 9955))
   8  server.register_function(get_file)
   9  server.serve_forever()


You need to create an account or log in to post comments to this site.


Click here to browse all 5551 code snippets

Related Posts