How to schedule a Python script to run at prescribed times
The method to schedule a Python script depends on your operating system. The general steps for Windows operating systems are given below. For more information about scheduled tasks, see the Windows help. For Unix and Linux systems, see the man entry for cron or crontab.
For more information on running a script or model at a prescribed time, see the blog post Scheduling a Python script or model to run at a prescribed time
Scheduled Tasks
- Open the Task Scheduler wizard.
- For Windows 7
- Click the Windows Start menu, click Control Panel > Administrative Tools and click Task Scheduler.
- For Windows Vista
- Click the Windows Start menu, click Settings, point to Control Panel, then click System and Maintenance. Click Administrative Tools and click Schedule tasks.
- For Windows XP
- Click the Windows Start menu, point to Control Panel, then double-click Scheduled Tasks.
- If the control panel is in category view, click Performance and Maintenance and click Scheduled Tasks.
- For Windows 2000 and NT
- Click the Windows Start menu, point to Settings, point to Control Panel, then click Scheduled Tasks.
- For Windows 7
- Double-click Add Scheduled Task (or Create Basic Task).
- Complete the options on the wizard. These options include when you want the scheduled task to run, the path to the script you want to run, and any arguments to the script.