(Sep-14-2021, 07:48 PM)cosmarchy Wrote: Is there something going on in the background with schedule which is not being closed down?Yes you have to use
Ctrl+c
to shut it down.Your second code with schedule is line 7 wrong.
Code will not run with that error,look at Cancel a job doc
So a example run.
import schedule import time def job(): print("I'm working...") schedule.every(10).seconds.do(job) while 1: schedule.run_pending() time.sleep(1)
Output:G:\div_code\answer
λ python 10_sec.py
I'm working...
I'm working...
I'm working...
I'm working...
Traceback (most recent call last):
File "G:\div_code\answer\10_sec.py", line 10, in <module>
time.sleep(1)
KeyboardInterrupt
^C
In background there will a process python.exe(python on Linux) running which has a own pid.If want to see processes in background eg shut down from Python look at psutil.