"Steven Woody" <narkewo...@gmail.com> writes: > What's the right type to represent a sequence of raw bytes. In C, > we usually do > > 1. char buf[200] or > 2. char buf[] = {0x11, 0x22, 0x33, ... } > > What's the equivalent representation for above in Python?
import array buf = array.array('b', [0x11, 0x22, ...]) It automatically retrieves byte values without having to call ord(), and it allows changing them. It also has a C API for getting to the address of the underlying buffer. -- http://mail.python.org/mailman/listinfo/python-list