【发布时间】:2019-07-23 10:47:03
【问题描述】:
我在 spyder 中将 python 脚本保存为blocking_oth,我想每天下午 4 点自动运行这个脚本
我已经试过了-
import schedule
import time
import os
def job():
os.system('Blocking_oth')
schedule.every().day.at("16:05").do(job)
while True:
schedule.run_pending()
time.sleep(1)
但这给了我错误:
"NameError: 名称 'Blocking_oth' 未定义"
【问题讨论】:
-
Scrapy on a schedule的可能重复