From f112d26d8cd0221e19d2abcafacdb648b7f9f9ee Mon Sep 17 00:00:00 2001 From: Benjamin Loison <12752145+Benjamin-Loison@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:12:01 +0200 Subject: [PATCH] Add Python syntax highlighting to `README.md` --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d503cd1..ecfdfec 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,15 @@ Python library Quick Python synopsis: - from lwpb.codec import MessageCodec +```py +from lwpb.codec import MessageCodec - codec = MessageCodec( pb2file='person.pb2', typename='example.Person' ) - serialized = codec.encode( { 'name': 'John Doe', 'id': 1234 } ) - deserialized = codec.decode( serialized ) +codec = MessageCodec( pb2file='person.pb2', typename='example.Person' ) +serialized = codec.encode( { 'name': 'John Doe', 'id': 1234 } ) +deserialized = codec.decode( serialized ) - print deserialized +print deserialized +``` This expects a compiled .proto file you can generate with: