Questions tagged [pep3118]

PEP 3118 is the Revised Buffer Protocol for the [tag:python] C-API.

PEP 3118 is the Revised Buffer Protocol for the C-API. Supported natively in Python 3 and backported to the 2.x series starting at Python 2.6, PEP 3118 specifies the use of the Py_buffer structure, and the variety of API functions provided for managing both the Py_buffer lifecycle (at the C-API level) and the new memoryview objects (at the Python level).

17 questions
2
votes
1 answer

What's the usage "multi-dimensional array" of Py_buffer in 2.x?

http://docs.python.org/2/c-api/buffer.html int ndim The number of dimensions the memory represents as a multi-dimensional array. If it is 0, strides and suboffsets must be NULL. What's the real world usage for this? Is it used for scatter gather…
est
  • 11,429
  • 14
  • 70
  • 118
1
vote
1 answer

Loading binary data from a file into a buffer in Python

I have a set of 640x480 images. I’m converting these images to a binary file format via Matlab… Now, I need to load each of the binary files into a buffer in Python, and then read data from that buffer. Can anyone help me out with how I might do…
user3397145
  • 787
  • 1
  • 5
  • 16
1
2