The simplest solution would be
"\x00" * size # for a buffer of binary zeros
[0] * size # for a list of integer zeros
In general you should use more pythonic code like list comprehension (in your example: [0 for unused in xrange(100)]
) or using string.join
for buffers.