错误 - 第一个参数必须是可调用的,我在使用函数时收到此错误

error - the first argument must be callable, i get this error while using function

for params in read_parameters_input_file.itertuples():
    timings = params.Time
    timing = timings
    base_price = params.Base_price
    stop_loss_pr = params.Stop_loss
    def run_code(timing, base_price, stop_loss_pr):
        ltp_data = kite_connection()
        b120(timing, ltp_data, base_price, stop_loss_pr)
    
    schedule.every().day.at(timings).do(run_code(timing, base_price, stop_loss_pr))
    
while True:
    schedule.run_pending()
    time.sleep(1)

在 run_code 函数中我调用了两个函数,这就是为什么在 运行 中代码参数有值,这在 b120 函数中使用。 我有这段代码,当我运行宁我的代码我得到一个错误 - 第一个参数必须是可调用的。 我不知道我在这里做错了什么。 请帮助我。

错误-

schedule 需要创建一个部分,因此需要一个“裸”功能。但是,该模块确实允许您按照 documentation 将参数传递给函数。所以你应该能够做到这一点;

schedule.every().day.at(timings).do(run_code, timing=timing, base_price=base_price, stop_loss_pr=stop_loss_pr))