Browse Source

Struct

pull/9/head
Jure Šorn 6 years ago
parent
commit
3aa852fe9d
1 changed files with 3 additions and 0 deletions
  1. 3
      README.md

3
README.md

@ -875,10 +875,13 @@ Struct
### Example ### Example
```python ```python
>>> from struct import pack, unpack, calcsize >>> from struct import pack, unpack, calcsize
>>> pack('hhl', 1, 2, 3) >>> pack('hhl', 1, 2, 3)
b'\x00\x01\x00\x02\x00\x00\x00\x03' b'\x00\x01\x00\x02\x00\x00\x00\x03'
>>> unpack('hhl', b'\x00\x01\x00\x02\x00\x00\x00\x03') >>> unpack('hhl', b'\x00\x01\x00\x02\x00\x00\x00\x03')
(1, 2, 3) (1, 2, 3)
>>> calcsize('hhl') >>> calcsize('hhl')
8 8
``` ```

Loading…
Cancel
Save