TypeError: the first argument must be callable

后端 未结 2 392
天涯浪人
天涯浪人 2021-02-06 04:38

I am using python and schedule lib to create a cron-like job

class MyClass:

        def local(self, command):
                #return subprocess.call(command, s         


        
2条回答
  •  花落未央
    2021-02-06 04:44

    replace

    schedule.every(1).minutes.do(self.local(script_path))
    

    with this one:

    schedule.every(1).minutes.do(self.local,script_path)
    

    and it will work fine..

    you should write the parameters of function after function name and comma separate them..

提交回复
热议问题