# Start the scheduler
sched = Scheduler()
sched.daemonic = False
sched.start()
def job_function():
print("Hello World")
print(datetime.datetime.now())
time.sleep(20)
# Schedules job_function to be run once each minute
sched.add_cron_job(job_function, minute='0-59')my questions are : 1)how this process works?
2)can i add two jobs that will run simultaneously? for example two bat files
3)how can i get the return value for the job?
2) what happens if the computer restart ?the scheduler start again by himself or should i run again the python script?Have you read the documentation? I suggest you do so first and then say if you have something you didn't understand.
As for your code, it looks like it was written for APScheduler
2.x or earlier. Look for the "examples" directory in the
APScheduler Github project for plenty of working examples that run
on the latest version.
--
You received this message because you are subscribed to the Google Groups "APScheduler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apscheduler...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to apscheduler+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "APScheduler" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/apscheduler/_mk8wbrr-Jo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to apscheduler+unsubscribe@googlegroups.com.
3) You can do this by listening to the appropriate scheduler
events. See
http://apscheduler.readthedocs.io/en/latest/userguide.html#scheduler-events
and
http://apscheduler.readthedocs.io/en/latest/modules/events.html#apscheduler.events.JobExecutionEvent
. The "retval" attribute on JobExecutionEvent will get you the
return value.
4) The scheduler is a part of your application, so unless you've
arranged for your application to restart on boot, it won't.
To unsubscribe from this group and stop receiving emails from it, send an email to apscheduler...@googlegroups.com.