Some python scrips for demonstrating chap protocol
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

chap-client.py 260B

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