Browse code
Edited README.markdown via GitHub
fiddlerwoaroof authored on 31/05/2011 17:31:25
Showing 1 changed files
Showing 1 changed files
... | ... |
@@ -9,23 +9,24 @@ A JSON-RPC 2.0 implementation for Python (Python 3 not supported yet) |
9 | 9 |
Listening on port 8007... |
10 | 10 |
|
11 | 11 |
- Start the Client: |
12 |
- - Python 2.7: `python -m jsonrpc <host name>` |
|
13 |
- - Python 2.6: `python -m jsonrpc.__main__ <host name>` |
|
12 |
+ Python 2.7: `python -m jsonrpc <host name>` |
|
13 |
+ |
|
14 |
+ Python 2.6: `python -m jsonrpc.__main__ <host name>` |
|
14 | 15 |
|
15 | 16 |
|
16 |
- >>> server.add(1, 2) |
|
17 |
- 3 |
|
17 |
+ >>> server.add(1, 2) |
|
18 |
+ 3 |
|
18 | 19 |
|
19 |
- >>> server.subtract(3,2) |
|
20 |
- 1 |
|
20 |
+ >>> server.subtract(3,2) |
|
21 |
+ 1 |
|
21 | 22 |
|
22 |
- # Exceptions |
|
23 |
- >>> server.add(1, '2') |
|
24 |
- Traceback (most recent call last): |
|
25 |
- File "<stdin>", line 1, in <module> |
|
26 |
- File "jsonrpc/proxy.py", line 182, in __call__ |
|
27 |
- raise JSONRPCException(resp['error']) |
|
28 |
- jsonrpc.proxy.JSONRPCException: unsupported operand type(s) for +: 'int' and 'unicode' |
|
23 |
+ # Exceptions |
|
24 |
+ >>> server.add(1, '2') |
|
25 |
+ Traceback (most recent call last): |
|
26 |
+ File "<stdin>", line 1, in <module> |
|
27 |
+ File "jsonrpc/proxy.py", line 182, in __call__ |
|
28 |
+ raise JSONRPCException(resp['error']) |
|
29 |
+ jsonrpc.proxy.JSONRPCException: unsupported operand type(s) for +: 'int' and 'unicode' |
|
29 | 30 |
|
30 | 31 |
|
31 | 32 |
>>> server.batch_call( dict(add=( (1,2), {} ), subtract=( (3,2), {} )) ) |