我有这样的功能:将Python函数作为参数传递而不执行它?
def a(one, two, the_argument_function):
if one in two:
return the_argument_function
我the_argument_function看起来是这样的:
def b(do_this, do_that):
print "hi."
两个以上的被导入到一个文件“main_functions.py”我的最终代码看起来像这样:
print function_from_main(package1.a, argument, package2.b(do_this, do_that)
的“如果一两”,从“一”功能的作品,但传递给“function_from_main”无は当“b”功能仍然执行从“a”检查它是否应该执行。
我该怎么办?
你叫'B'明确的条件时,如何它会*不*执行? – timgeb
@timgeb你完全理解我的问题。现在呢,我该如何让它不能执行? –
不叫它.. – timgeb