On Wed, Mar 21, 2012 at 4:51 PM, Nelson Jones <huawe...@gmail.com> wrote:
> I wrote a simple script.
> from datetime import date
> from apscheduler.scheduler import Scheduler
>
> # Define the function that is to be executed
> def my_job(text):
> print text
>
> # Start the scheduler
> sched = Scheduler()
> sched.start()
>
> # The job will be executed on November 6th, 2009
> exec_date = date(2019, 11, 6)
>
> # Store the job in a variable in case we want to cancel it
> job = sched.add_date_job(my_job, exec_date, ['text'])
>
> It will exit.
> I had to write a mutithreaded code and put the above logic in the
> child thread and force the main thread the loop.
> Is there more elegant way to deamonize the AP?
>
> Thanks,