From: Chris Hare on
Don't say cron :

I want to have a section of my code executed at 15 minute intervals. I am using Threading.timer, but it is causing a problem sinxe I am using sqlite3 and the thread support gives me an error, which aborts part of my code.

So, is there an alternative to threading.timer?

From: Dave Angel on
Chris Hare wrote:
> Don't say cron :
>
> I want to have a section of my code executed at 15 minute intervals. I am using Threading.timer, but it is causing a problem sinxe I am using sqlite3 and the thread support gives me an error, which aborts part of my code.
>
> So, is there an alternative to threading.timer?
>
>
Depends on how that "section of code" relates to the rest of your code.
If it's independent of the rest, then you can use subprocess to launch a
separate process. That won't interfere with your main code. But of
course if your main code is blocked for 20 minutes, it'll never get to
the part which should run the subprocess.

If your main code is running wxPython, you can set a timer, and just
trigger an event like all the others.

But without knowing more about your two pieces of code, the only
reliable answer is 'cron'.

DaveA

From: Jesse Jaggars on
On Wed, Aug 4, 2010 at 2:44 PM, Chris Hare <chare(a)labr.net> wrote:
> Don't say cron :
>
> I want to have a section of my code executed at 15 minute intervals.  I am using Threading.timer, but it is causing a problem sinxe I am using sqlite3 and the thread support gives me an error, which aborts part of my code..
>
> So, is there an alternative to threading.timer?
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Take a look at sched. http://docs.python.org/library/sched.html