简体   繁体   English

Python Script Scheduling

[英]Python Script Scheduling

I am a complete novice, and have had a script written for me that scrapes football stats data.

I would like to automate this process nightly at 8 pm, however, have not been able to crack it. I assume it is not overly complex - however it has been for my inexperience.

My "googling" has led me to "pip install schedule" ... and I have followed directions to create ...

# au_john_finalsiren_V9.py  
import schedule 
import time

def au_john_finalsiren_V9.py()
    schedule.every().day.at(20:00:00").do(au_john_finalsiren_V9.py)

while True:
   schedule.run_pending()
   time.sleep(1)

But I am missing something!!

All help is appreciated!!

JR

The issue is in your code and function calling.问题出在您的代码和 function 调用中。 Try to modify it in the following way:尝试通过以下方式对其进行修改:

 # au_john_finalsiren_V9.py import schedule import time def au_john_finalsiren_V9(): print('This is a function that is called every day at 20:00') schedule.every().day.at("20:00").do(au_john_finalsiren_V9) while True: schedule.run_pending() time.sleep(1)

In the function au_john_finalsiren_V9 write the code that should be executed.在 function au_john_finalsiren_V9中编写应该执行的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM