The windows system has a scheduled task function, through which we can run python programs regularly.
Specific method:
First prepare your own python.py or pyw file and copy its path. The path is best in English;
Enter the task scheduler control page:
My Computer-Management-Task Scheduler-Task Plan Library
Click on the right to create a task:
In Trigger - Create a new task under the New menu, and the number of repetitions can be set in the advanced settings of the task.
Note: The time unit in the recurring task interval can be edited. You can edit the unit as minutes. The default minimum interval is 1 hour, but you can manually change the hour to Edit to minutes to run every minute.
Configure the tasks you want to run regularly under the Operation-Add window. Select the startup program and fill in three boxes at once: python.exe or pythonw.exe; fill in the second box with the full path of the python_code.py script you want to start; fill in the third box with the path of the python interpreter, that is python installation path.
The configuration has been completed here. After confirmation, the task will be entered into the Windows task schedule library.
Related recommendations: windows system
The above is the detailed content of How to run python program regularly in windows. For more information, please follow other related articles on the PHP Chinese website!