I need to call functions in a C dll from python. So I need to write functions of the format
def funcA(self):
ans = ctypes.uint64()
self.driver.getA(ctypes.byref(ans))
return ans
now I have to write the same code about 30 times, the only difference in each being the name of function called funcA , funcB , funcC and similarly the dll function getA, getB, getC and the type of the return values which can vary
typically I could like to just have a dict
funcs = { 'A':'uint64', 'B':'bool'}
and automatically generate functins
funcA and funcB , with almost the same structure as shown on top , except for the types and the variable names. I would guess there would be some libraries for it.