https://github.com/takp/protobuf-sample
https://github.com/takp/protobuf-sample
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/takp/protobuf-sample
- Owner: takp
- Created: 2018-11-01T02:32:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-01T04:30:49.000Z (over 6 years ago)
- Last Synced: 2024-12-27T09:27:52.780Z (5 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Protobuf-sample
This is sample code of Protocol Buffers based on [python tutorial](https://developers.google.com/protocol-buffers/docs/pythontutorial).
## Usage
- Write to output file
```bash
$ python write.py output_file
output_file: Could not open file. Creating a new one.
Enter person ID number: 111
Enter name: John
Enter email address (blank for none): [email protected]
Enter a phone number (or leave blank to finish): 001001001
Is this a mobile, home, or work phone? mobile
Enter a phone number (or leave blank to finish): 001001011
Is this a mobile, home, or work phone? work
Enter a phone number (or leave blank to finish):
```- Read output_file
```bash
$ python read.py output_file
Person ID: 111
Name: John
E-mail address: [email protected]
Mobile phone #:
001001001
Work phone #:
001001011
```