using builtin array

Diez B. Roggisch deets at web.de
Wed Jun 1 19:30:15 EDT 2005


ashtonn at gmail.com wrote:
> I am constructing a packet, with the first 6 bytes being the
> destination address, followed by src, and  type.

As I told you - use struct.

> The remaining space
> will be filled with data. I need to use an array because of the
> buffer_info method i am calling.

That's a circular argument - to use arrays because of a methods arrays 
habe. Use lists instead. And if you really need that buffer_info, you 
could create a string with struct and then make an array of bytes out of 
that.

Arrays are homogenous. No chance concatenating them.


Diez



More information about the Python-list mailing list