
Once I saved the Notepad, a new batch file (called Run_Python_Script) got created on my desktop: Here is a glance of how my Notepad would look like after adding the paths:įinally, save the Notepad with your file name and the “bat” extension:įor example, I decided to save the Notepad on my Desktop as: You’ll need to adjust those paths to fit your instances.
Path where my Python script is stored\script name.py is (see step-2):. “C:\Users\Ron\AppData\Local\Programs\Python\Python37-32\python.exe” Path where my Python exe is stored\python.exe is:. To start, open Notepad, and then apply the following generic structure: "Path where your Python exe is stored\python.exe" "Path where your Python script is stored\script name.py" Next, you’ll need to create a batch file to run the Python script. In my case, I saved the Python script on my Desktop, under this path:Ĭ:\Users\Ron\Desktop\Hello_World.py Step-3: Create Batch File to Run the Python Script Once you’re done writing the script, save it as a Python file (which should have the. Label1 = tk.Label(root, text='Hello World!')Ĭanvas1.create_window(150, 150, window=label1) Here is the Python script that I used: import tkinter as tkĬanvas1 = tk.Canvas(root, width = 300, height = 300) In our example, I’ll use the tkinter module to display the label of ‘Hello World!.’Īlternatively, you may use any Python script that you’d like to schedule. Hope it’s not too early… Steps to Schedule Python Script using Windows Scheduler Step-1: Prepare the Python Script To show you how the process works, I’ll use a simple example that will display ‘Hello World!’ each day at 6am. In this tutorial, I’ll show you the steps to schedule a Python script using Windows Scheduler. This type of exercise is especially useful when you want to run a Python script at prescribed times.