I want to create python functions on the go, with the following template:
def x(sender,data):
r=b''
r+=sender.send_type0(data[0])
r+=sender.send_type1(data[1])
r+=sender.send_type2(data[2])
...
r+=sender.send_typen(data[n])
return r
I want to create many of those functions from an array which holds type data as a 2D array. I can generate simple functions at runtime, but there I would like to run a for-statement only at the generation, and not at every call of the function. How can I achieve this?
sender? How can a byte string become a function? I'm not following your example.