OLD | NEW |
(Empty) | |
| 1 gRPC in 3 minutes (Python) |
| 2 ======================== |
| 3 |
| 4 Background |
| 5 ------------- |
| 6 For this sample, we've already generated the server and client stubs from |
| 7 [helloworld.proto][] and we'll be using a specific reference platform. |
| 8 |
| 9 |
| 10 Install gRPC: |
| 11 ```sh |
| 12 $ pip install grpcio |
| 13 ``` |
| 14 Or, to install it system wide: |
| 15 ```sh |
| 16 $ sudo pip install grpcio |
| 17 ``` |
| 18 |
| 19 Download the example |
| 20 ```sh |
| 21 $ # Clone the repository to get the example code: |
| 22 $ git clone https://github.com/grpc/grpc |
| 23 $ # Navigate to the "hello, world" Python example: |
| 24 $ cd grpc/examples/python/helloworld |
| 25 ``` |
| 26 |
| 27 Try it! |
| 28 ------- |
| 29 |
| 30 - Run the server |
| 31 |
| 32 ```sh |
| 33 $ python2.7 greeter_server.py & |
| 34 ``` |
| 35 |
| 36 - Run the client |
| 37 |
| 38 ```sh |
| 39 $ python2.7 greeter_client.py |
| 40 ``` |
| 41 |
| 42 Tutorial |
| 43 -------- |
| 44 |
| 45 You can find a more detailed tutorial in [gRPC Basics: Python][] |
| 46 |
| 47 [helloworld.proto]:../protos/helloworld.proto |
| 48 [Install gRPC Python]:../../src/python#installation |
| 49 [gRPC Basics: Python]:http://www.grpc.io/docs/tutorials/basic/python.html |
OLD | NEW |