Python Forum
How to trigger python script twice a day
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to trigger python script twice a day
#2
I didn't use schedule module before, but it seems from docs that you need to run it in an infinite loop, i.e. your code should be something like this:

import schedule
import time
 
def job():
    print("I'm working...")
    print("hi at %s" % time.ctime())

schedule.every().day.at("23:06").do(job)
schedule.every().day.at("23:08").do(job)

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


Messages In This Thread
RE: How to trigger python script twice a day - by scidam - Aug-30-2019, 01:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pandas, How to trigger parallel loop Mekala 4 933 Oct-29-2020, 12:58 PM
Last Post: Mekala
  How to kill a bash script running as root from a python script? jc_lafleur 4 1,639 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 899 May-28-2020, 05:27 PM
Last Post: micseydel
  Package python script which has different libraries as a single executable or script tej7gandhi 1 1,265 May-11-2019, 08:12 PM
Last Post: keames
  How to run python script which has dependent python script in another folder? PrateekG 1 1,630 May-23-2018, 04:50 PM
Last Post: snippsat
  How to call one python script and use its output in another python script lravikumarvsp 3 27,393 May-16-2018, 02:08 AM
Last Post: lravikumarvsp
  Why does my Switch trigger all Cases? IAMK 6 1,911 Apr-09-2018, 11:12 AM
Last Post: snippsat
  Check Python version from inside script? Run Pythons script in v2 compatibility mode? pstein 2 8,102 Jul-07-2017, 08:59 AM
Last Post: snippsat
  How to trigger a function by clicking the left mouse click? HelloBoyz 1 5,622 Jun-29-2017, 09:43 PM
Last Post: nilamo
  Cant pass corect variables to python script in bash script neradp 3 4,099 Nov-05-2016, 01:26 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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