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()