Update README with example of calling protoc from python (#149)

This commit is contained in:
Jonas Kalderstam 2020-09-19 17:03:49 +02:00 committed by GitHub
parent a3f5f21738
commit 58556e0eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,13 +70,20 @@ message Greeting {
} }
``` ```
You can run the following: You can run the following to invoke protoc directly:
```sh ```sh
mkdir lib mkdir lib
protoc -I . --python_betterproto_out=lib example.proto protoc -I . --python_betterproto_out=lib example.proto
``` ```
or run the following to invoke protoc via grpcio-tools:
```sh
pip install grpcio-tools
python -m grpc_tools.protoc -I . --python_betterproto_out=lib example.proto
```
This will generate `lib/hello/__init__.py` which looks like: This will generate `lib/hello/__init__.py` which looks like:
```python ```python