import xmlrpclib Create an object to represent our server server_url h

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import xmlrpclib
# Create an object to represent our server.
server_url = 'http://xmlrpc-c.sourceforge.net/api/sample.php';
server = xmlrpclib.Server(server_url);
# Call the server and get our result.
result = server.sample.sumAndDifference(5, 3)
print "Sum:", result['sum']
print "Difference:", result['difference']