Simple XML-RPC server using python, communicates two local shells to performa a POST query and get the response on another shell.
Last active
February 20, 2023 20:59
-
-
Save carlosmgv02/01c23be16cf7c76dc21b59e91836a99a to your computer and use it in GitHub Desktop.
Python XML-PRC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
beautifull