From 70b9f5524656182f35f286d67dc7a5b01edc6011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Mon, 19 Nov 2018 22:51:43 +0100 Subject: [PATCH] Bytes and Struct --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7863cf3..1ebd2ac 100644 --- a/README.md +++ b/README.md @@ -637,20 +637,27 @@ raise IOError("input/output error") Bytes ----- -**Bytes objects are immutable sequences of single bytes:** +**Bytes objects are immutable sequences of single bytes.** + +#### Str: ```python -# str = b'' = .decode('utf-8') +``` -# int +#### Int: +```python = .to_bytes(, byteorder='big|small', signed=False) = int.from_bytes(, byteorder='big|small', signed=False) +``` -# hex +#### Hex: +```python = bytes.fromhex() = .hex() +``` +```python = b''.join() ```