Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to schedule execution of code?

8 views
Skip to first unread message

Virgil Stokes

unread,
Mar 15, 2011, 3:16:52 AM3/15/11
to pytho...@python.org
Suppose that I have some Python code (vers. 2.6) that has been converted into an
*.exe file and can be executed on a Windows (Vista or 7) platform. What can one
do to have this *.exe executed at a set of specific times each day? In addition,
if a day is missed (e.g. computer on which it resides goes down), then it will
be executed the next time the computer is successfully started up.

It might be useful to know that the purpose of this code is to collect data from
a set of RSS feeds.

Any suggestions would be appreciated.

Tim Golden

unread,
Mar 15, 2011, 4:53:59 AM3/15/11
to pytho...@python.org
On 15/03/2011 07:16, Virgil Stokes wrote:
> Suppose that I have some Python code (vers. 2.6) that has been converted
> into an *.exe file and can be executed on a Windows (Vista or 7)
> platform. What can one do to have this *.exe executed at a set of
> specific times each day?

Well, once you've got an .exe, the question isn't really Python-specific
any more. (Even without the .exe it's not really Python-specific...)
Use the Windows Scheduler. You can schedule a program to run at
certain times and on startup. When it fires up, it can check when
it was last run (by writing to a file / registry on firing up)
and deciding whether or not it needs to run.

The alternative is to have it install as a service and then run
its own scheduler loop, but that doesn't offer any real advantage:
you're just reinventing the Windows Task Scheduler.

TJG

Irmen de Jong

unread,
Mar 15, 2011, 3:30:34 PM3/15/11
to

Have you tried the Windows Task Scheduler tool?

Irmen

0 new messages