def pack_list(fmt, data):
    func = struct.Struct(fmt).pack
    return create_string_buffer(''.join([func(x) for x in data]))
Convert a Python list into a ctypes buffer.
dataset/ETHPy150Open fogleman/pg/pg/util.py/pack_list