Running a python code periodically

castironpi at gmail.com castironpi at gmail.com
Thu May 8 20:12:16 EDT 2008


On May 8, 3:31 pm, "Terry Reedy" <tjre... at udel.edu> wrote:
> "Maryam Saeedi" <ma.sae... at gmail.com> wrote in message
>
> news:ee9cd3be0805080902g48e641bxbcf1d5578620defe at mail.gmail.com...
> |I was wondering if you know how can I run a python code once every five
> | minutes for a period of time either using python or some other program
> like
> | a bash script.
>
> I expect the following should work.
>
> from time import sleep
> while True: #or
> # for i in range(nunber_of_cycles):
>   do_whatever()
>   sleep(600)
>
> assuming do_whatever() is quick and you do not need exactly 5 minute
> intervals.
>
> | I have asked this question before and some of you answered me but I still
> | have problem. Most of the answers was to use cron and crontab which works
> on
> | my computer but not if I want to do it on department's computer since I
> do
> | not have permission to change those files. Is there any other way which
> does
> | not need administrator permission?

I'm on Windows, but it's fine.

I've written a driver for in-time hooks with the Keyboard and Mouse
before, just not in Python.  If MinGW can color it, it'll show up on
the newsgroup.  From preliminary evaluations of the number of
dimensions of human perception (including basis vectra), you could
pass colors in time: colors harmonize in more dimensions than sound
does; you couldn't do the same thing with sound, necessarily, unless
you seat at a bar.



More information about the Python-list mailing list