Last active
August 29, 2015 14:06
-
-
Save xingkaixin/3d9193436b50a57a886e to your computer and use it in GitHub Desktop.
RPC Simple Python
This file contains hidden or 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
| Server: | |
| 127.0.0.1 - - [14/Sep/2014 00:30:57] "POST /RPC2 HTTP/1.1" 200 - | |
| Client: | |
| result: -60 | |
| result type: <type 'int'> |
This file contains hidden or 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 xmlrpclib import ServerProxy | |
| server = ServerProxy("http://localhost:8000") | |
| try: | |
| ret = server.add(30,90) | |
| print 'result:', ret | |
| print 'result type:', type(ret) | |
| except Exception as ex: | |
| print "exception", ex |
This file contains hidden or 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 xmlrpclib import ServerProxy | |
| server = ServerProxy("http://localhost:8000") | |
| try: | |
| ret = server.minus(30,90) | |
| print 'result:', ret | |
| print 'result type:', type(ret) | |
| except Exception as ex: | |
| print "exception", ex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment