我有这个功能:
def a(one, two, the_argument_function):
if one in two:
return the_argument_function
Run Code Online (Sandbox Code Playgroud)
我的 the_argument_function 看起来像这样:
def b(do_this, do_that):
print "hi."
Run Code Online (Sandbox Code Playgroud)
以上两个都导入到文件“main_functions.py”中,我的最终代码如下所示:
print function_from_main(package1.a, argument, package2.b(do_this, do_that)
Run Code Online (Sandbox Code Playgroud)
来自“a”函数的“如果二分之一”有效,但“b”函数在传递给“function_from_main”时仍会执行,而无需等待来自“a”的检查以查看它是否确实应该执行。
我能做什么?