File: readmsg.py

package info (click to toggle)
r-cran-rprotobuf 0.4.23-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,392 kB
  • sloc: cpp: 4,060; ansic: 462; python: 43; sh: 30; makefile: 27
file content (16 lines) | stat: -rw-r--r-- 322 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/python3
#
# Simple test script to read a serialized message in python
#
import rexp_pb2
import glob

messages = glob.glob("*.msg")
for myfile in messages:
	print("Reading message " + myfile + " ...")
	f = open(myfile, 'rb')
	msg = rexp_pb2.REXP()	
	msg.ParseFromString(f.read())
	f.close()
	print(msg)
	del msg