import schedule
import time
def test():
print("Stopped")
# I tried these two commands below it's not helping or maybe I am doing it wrong.
# schedule.cancel_job(test)
# schedule.clear()
schedule.every().day.at("21:43").do(test)
while True:
schedule.run_pending()
time.sleep(1)
I want to cancel job once it's completed, here I know it's not completed because I have used day so it runs each day, but I just want to cancel this job once it's performed or if is there any other way to do same thing it will be good and it must be easy like schedule. Technically I have created a python bot there are multiple scheduled tasks I want to implement this idea there. Plus I am not understanding this if it relates to my query: