#coding: utf-8 def criteria_1(param_1): print 'criteria 1' print 'param_1:', param_1 print '' def criteria_2(param_1, param_2): print 'criteria 2' print 'param_1:', param_1 print 'param_2:', param_2 print '' def criteria_3(param_1, param_2, param_3): print 'criteria 3' print 'param_1:', param_1 print 'param_2:', param_2 print 'param_3:', param_3 print '' def call_wrapper(func_name, var_list): varcls = variables() func = globals()[func_name] params = {} for var in var_list: params[var] = getattr(varcls, var) func(**params) class variables: def __init__(self): self.param_1 = 'variable1' self.param_2 = 12.25 self.param_3 = (1, 2, 3) # test # function names and variable names function_names = ['criteria_1', 'criteria_2', 'criteria_3'] var_names = ['param_1', 'param_2', 'param_3'] # run criteria_1 only by names call_wrapper('criteria_1', ['param_1']) call_wrapper('criteria_2', ['param_1', 'param_2']) call_wrapper('criteria_3', ['param_1', 'param_2', 'param_3'])