Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. from google.protobuf import text_format
  2.  
  3. f = open('a.txt', 'r')
  4. address_book = addressbook_pb2.AddressBook() # replace with your own message
  5. text_format.Parse(f.read(), address_book)
  6. f.close()
  7.  
  8. f = open('b.txt', 'w')
  9. f.write(text_format.MessageToString(address_book))
  10. f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement