[IPython-User] write binary with struct.pack_into

Thomas Kluyver takowl@gmail....
Sat Oct 6 13:36:49 CDT 2012


Hi Ronaldo,

This list is actually about IPython, an interactive Python shell. It
sounds like your question is about using Python in general. In future,
the programming Q&A site Stackoverflow is a good place for this kind
of question: http://stackoverflow.com/questions/tagged/python

On 6 October 2012 04:33, palmeira <palmeira@gmail.com> wrote:
> test=struct.pack_into(bloco,fb.write()[0*4:251*4])  # ERROR in this WRITE

This is your problem, though. It should look more like:
struct.pack_into(bloco, fb, 0, my_array)

The docs are here: http://docs.python.org/library/struct.html#struct.pack_into

Best wishes,
Thomas


More information about the IPython-User mailing list