Are you sure you have one sensor message that is 250Mb? It seems too big to 
me. Do you know how the protobuf message was written to the file?. It hard 
to believe it is just one message that big.
If it is more than one sensor message, I think you have to read from the 
file up to the size of message and parse it.

-Tom

On Thursday, April 2, 2020 at 6:36:09 AM UTC-7, Roozbeh wrote:
>
> I am new to protocol buffers, I am given a signal data saved in .protobin 
> file 
> and I am trying to parse the sensor data in python. I have installed the 
> protoc compiler and compiled the example.proto file with python_out option 
> and extracted example_pb2.py.
>
> I read the file using the following script:
>
> import example_pb2
> with open('test_data.protobin','rb') as f:
>     data = f.read()
>
> msg = example_pb2.Sensor()
> msg.ParseFromString(data)
>
> The test_data.protobin data is 250Mb but the msg is empty and does not 
> contain any information in it.
>
> What am I doing wrong here?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/d951f948-c895-43e2-9452-238677a5da1c%40googlegroups.com.

Reply via email to