blob: b57da8f6428846027b455e842828c792f0bd7852 [file] [log] [blame] [view]
Nathaniel Manista4e7ea932015-10-07 14:34:08 +00001gRPC in 3 minutes (Python)
2========================
3
4Background
5-------------
6For 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
Nathaniel Manista4e7ea932015-10-07 14:34:08 +00009
Stanley Cheunge8130a12016-02-16 21:13:18 -080010Install gRPC:
Nathaniel Manista4e7ea932015-10-07 14:34:08 +000011 ```sh
Stanley Cheunge8130a12016-02-16 21:13:18 -080012 $ pip install grpcio
13```
14Or, to install it system wide:
15```sh
16 $ sudo pip install grpcio
17```
18
19Download the example
20```sh
Nathaniel Manista4e7ea932015-10-07 14:34:08 +000021 $ # 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
27Try 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
42Tutorial
43--------
44
45You 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