def double_output(func, argtypes, errcheck=False, strarg=False):
 func.argtypes = argtypes
 func.restype = c_double
 if errcheck:
  func.errcheck = check_arg_errcode
 if strarg:
  func.errcheck = check_str_arg
 return func

def double_output ( func , argtypes , errcheck = False , strarg = False ) : func . argtypes = argtypes func . restype = c_double if errcheck : func . errcheck = check_arg_errcode if strarg : func . errcheck = check_str_arg return func
generates a ctypes function that returns a double value .