Skip to content
Snippets Groups Projects
Commit 1dd65870 authored by Chao Zhan's avatar Chao Zhan
Browse files

add python exercise

parent acc4df33
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,23 @@ It is a mechanism that allows an object residing in one system (JVM) to access/i ...@@ -43,6 +43,23 @@ It is a mechanism that allows an object residing in one system (JVM) to access/i
**Note:** RMI is a Java-specific implementation of RPC. **Note:** RMI is a Java-specific implementation of RPC.
---
title: RPC in Python
---
## Exercise: Using RPC in Python
Python provides built-in support for RPC through the [xmlrpc](https://docs.python.org/3/library/xmlrpc.html) module.
1. Try the example in `exercises/python-rpc` with your teammates.
2. Modify the example to implement RPC services that sends bytes of a file (e.g. `yourimage.jpg`) to the client.
**Hint**:
- Use `open` to open a file and read it in binary mode.
- Use `xmlrpc.client.Binary` to wrap the bytes.
- You can find example in the documentation of [xmlrpc](https://docs.python.org/3/library/xmlrpc.html).
--- ---
title: P2P title: P2P
--- ---
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment