255 argument limit?

Fredrik Lundh fredrik at pythonware.com
Wed Oct 25 17:21:03 CEST 2006


Michael Yanowitz wrote:

>    It appears that there is a 255 argument limit in Python 2.4.3?
> 
>>>> packed_data = struct.pack("260i", /... snip .../)

ouch.  if you need to pass large amounts of data to struct.pack (or any 
other function), use a sequence:

import struct

data = range(1000000)

packed_data = struct.pack("1000000i", *data)

print len(packed_data) # prints 4000000

</F>




More information about the Python-list mailing list