From cb21e6ad110f39a34fb92d7184335bdec757248b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= <sornjure@gmail.com> Date: Sat, 29 Dec 2018 16:37:37 +0100 Subject: [PATCH] Struct --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 1fd66aa..6017ed2 100644 --- a/README.md +++ b/README.md @@ -875,13 +875,19 @@ Struct ### Example ```python >>> from struct import pack, unpack, calcsize +``` +```python >>> pack('hhl', 1, 2, 3) b'\x00\x01\x00\x02\x00\x00\x00\x03' +``` +```python >>> unpack('hhl', b'\x00\x01\x00\x02\x00\x00\x00\x03') (1, 2, 3) +``` +```python >>> calcsize('hhl') 8 ```