Skip to content

Commit

Permalink
Merge pull request grpc#3696 from nathanielmanistaatgoogle/grpc-in-3-…
Browse files Browse the repository at this point in the history
…minutes-python

"gRPC in 3 minutes" for Python
  • Loading branch information
LisaFC committed Oct 7, 2015
2 parents 1331bf3 + 4e7ea93 commit 24b0d3c
Show file tree
Hide file tree
Showing 2 changed files with 257 additions and 0 deletions.
55 changes: 55 additions & 0 deletions examples/python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
gRPC in 3 minutes (Python)
========================

Background
-------------
For this sample, we've already generated the server and client stubs from
[helloworld.proto][] and we'll be using a specific reference platform.

Prerequisites
-------------

- Debian 8.2 "Jessie" platform with `root` access
- `git`
- `python2.7`
- `pip`
- Python development headers

Set-up
-------
```sh
$ # install the gRPC Core:
$ sudo apt-get install libgrpc-dev
$ # install gRPC Python:
$ sudo pip install -U grpcio==0.11.0b1
$ # Since this "hello, world" example uses protocol buffers:
$ sudo pip install -U protobuf==3.0.0a3
$ # Clone the repository to get the example code:
$ git clone https://github.com/grpc/grpc
$ # Navigate to the "hello, world" Python example:
$ cd grpc/examples/python/helloworld
```

Try it!
-------

- Run the server

```sh
$ python2.7 greeter_server.py &
```

- Run the client

```sh
$ python2.7 greeter_client.py
```

Tutorial
--------

You can find a more detailed tutorial in [gRPC Basics: Python][]

[helloworld.proto]:../protos/helloworld.proto
[Install gRPC Python]:../../src/python#installation
[gRPC Basics: Python]:http:https://www.grpc.io/docs/tutorials/basic/python.html
202 changes: 202 additions & 0 deletions examples/python/helloworld/helloworld_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 24b0d3c

Please sign in to comment.