Browse by Topic
Popular
Popular Posts
Latest
Latest Posts
Python memoryview Usage: Avoiding Copies in Binary Data
Learn how Python's memoryview reads and modifies binary data without copying, including slicing, casting, writable views, and where the performance benefit is real.
Python memoryview: Zero-Copy Buffer Access
Learn how Python memoryview provides zero-copy access to an object's underlying buffer, enabling efficient slicing and manipulation of binary data without unnecessary copies.
Python bytes.fromhex(): Convert Hex Strings to Bytes
Use Python's bytes.fromhex() method to convert hexadecimal strings into bytes objects. Includes whitespace handling, ValueError cases, bytes vs bytearray choices, and practical examples.
Converting Between Bytes and Hex in Python
Learn to convert bytes to hex strings and back in Python with bytes.hex(), bytes.fromhex(), and binascii, including code examples and memory considerations.
Python Bytes Slicing: Syntax and Behavior
python bytes slicing: Learn how to slice bytes objects in Python: syntax, step, negative indices, copy behavior, and practical binary data extraction.
Python Bytes Indexing: How It Works and Where It Breaks
Indexing into a Python bytes object returns an integer, not a one-byte bytes object. Learn how bytes indexing and slicing work and avoid common binary data pitfalls.
Python bytes vs bytearray: Choosing the Right Binary Type
Compare Python's bytes and bytearray types: mutability, memory behavior, performance, and when to use each for binary data handling.
Python bytearray: Mutable Bytes for Binary Data
Learn how to create, modify, and convert Python bytearray objects for binary data handling, with practical examples for network packets, file editing, and common pitfalls.
Python Bytes Literal Explained with Examples
python bytes literal: Learn how to write and use Python bytes literals, including syntax, encoding, and common pitfalls when working with binary data.
Working with Python Bytes: Creation, Encoding, and Binary I/O
Practical examples for creating, manipulating, encoding, and decoding Python bytes, including binary I/O and performance tips.