|
|
|
|
|
|
|
|
#!/usr/bin/env python2 |
|
|
#!/usr/bin/env python2 |
|
|
|
|
|
|
|
|
import xmlrpclib |
|
|
|
|
|
|
|
|
import xmlrpc.client |
|
|
|
|
|
|
|
|
s = xmlrpclib.ServerProxy('http://localhost:8000') |
|
|
|
|
|
print s.pow(2,3) # Returns 2**3 = 8 |
|
|
|
|
|
print s.add(2,3) # Returns 5 |
|
|
|
|
|
print s.div(5,2) # Returns 5//2 = 2 |
|
|
|
|
|
|
|
|
s = xmlrpc.client.ServerProxy('http://localhost:8000') |
|
|
|
|
|
print( s.pow(2,3) ) # Returns 2**3 = 8 |
|
|
|
|
|
print( s.add(2,3) ) # Returns 5 |
|
|
|
|
|
print( s.div(5,2) ) # Returns 5//2 = 2 |
|
|
|
|
|
|
|
|
# Print list of available methods |
|
|
# Print list of available methods |
|
|
print s.system.listMethods() |
|
|
|
|
|
|
|
|
print( s.system.listMethods() ) |