Created
August 24, 2017 23:28
-
-
Save plantvsbirds/dbe5c1c12b2430ec1166190e2afdc540 to your computer and use it in GitHub Desktop.
reading protobuf definition from compiled python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model_pb2 as M | |
# model_pb2 could be the compiled source | |
from google.protobuf.descriptor_pb2 import FileDescriptorProto | |
f = FileDescriptorProto() | |
f.MergeFromString(M.DESCRIPTOR.serialized_pb) | |
print f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment