Python Forum
Running Python script through Task Scheduler?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running Python script through Task Scheduler?
#8
(Mar-10-2024, 06:03 PM)Winfried Wrote: After I followed the instructions above, I can see the screen flicker every minute (looks like a CMD window opens and closes real fast) but I don't see Notepad.
Then it probably working.
Change to this and test again,now it will force cmd to stay open.
import subprocess

subprocess.Popen(['C:/Windows/System32/notepad.exe'])
input('Press enter to exit')
Quote:If there's an easier way to run a Python script on Windows once every day, I'm not wed with MS' Task Scheduler.
Python job scheduling for humans
# pip install schedule
import schedule
import time

def job():
    print("I'm working...")

schedule.every(.1).minutes.do(job) # Woking test 10 sec
# schedule.every().day.at("10:30").do(job)
while True:
    schedule.run_pending()
    time.sleep(1)
Reply


Messages In This Thread
RE: Running Python script through Task Scheduler? - by snippsat - Mar-10-2024, 07:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  No Internet connection when running a Python script basil_555 8 986 Mar-11-2024, 11:02 AM
Last Post: snippsat
  Help Running Python Script in Mac OS emojistickers 0 435 Nov-20-2023, 01:58 PM
Last Post: emojistickers
  Trying to make a board with turtle, nothing happens when running script Quascia 3 836 Nov-01-2023, 03:11 PM
Last Post: deanhystad
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,836 Jun-29-2023, 11:57 AM
Last Post: gologica
  Python script running under windows over nssm.exe JaroslavZ 0 832 May-12-2023, 09:22 AM
Last Post: JaroslavZ
  Running script with subprocess in another directory paul18fr 1 4,532 Jan-20-2023, 02:33 PM
Last Post: paul18fr
  count certain task in task manager[solved] kucingkembar 2 1,257 Aug-29-2022, 05:57 PM
Last Post: kucingkembar
  Running script on multiple files Afrodizzyjack 1 2,611 May-14-2021, 10:49 PM
Last Post: Yoriz
  Schedule a task and render/ use the result of the task in any given time klllmmm 2 2,250 May-04-2021, 10:17 AM
Last Post: klllmmm
  Error when running script on startup in Linux NoahTheNerd 0 2,061 Mar-07-2021, 04:54 PM
Last Post: NoahTheNerd

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020