Skip to content

Instantly share code, notes, and snippets.

@carlosmgv02
Last active February 20, 2023 20:59
Show Gist options
  • Save carlosmgv02/01c23be16cf7c76dc21b59e91836a99a to your computer and use it in GitHub Desktop.
Save carlosmgv02/01c23be16cf7c76dc21b59e91836a99a to your computer and use it in GitHub Desktop.
Python XML-PRC

Python XML-RPC server

Simple XML-RPC server using python, communicates two local shells to performa a POST query and get the response on another shell.

import xmlrpc.client
proxy= xmlrpc.client.ServerProxy("http://localhost:4000/")
num1= 30
num2= 50
result = proxy.add(num1, num2)
print("La suma de los dos valores es: ", result)
from xmlrpc.server import SimpleXMLRPCServer
def add(num1, num2):
return num1 +num2
print("Server is running...")
server = SimpleXMLRPCServer(("localhost", 4000))
server.register_function(add, "add")
server.serve_forever()
@nilm9
Copy link

nilm9 commented Feb 20, 2023

beautifull

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment