Re: Running a python code periodically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Reedy

    Re: Running a python code periodically


    "Maryam Saeedi" <ma.saeedi@gmai l.comwrote in message
    news:ee9cd3be08 05080902g48e641 bxbcf1d5578620d efe@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?



  • castironpi@gmail.com

    #2
    Re: Running a python code periodically

    On May 8, 3:31 pm, "Terry Reedy" <tjre...@udel.e duwrote:
    "Maryam Saeedi" <ma.sae...@gmai l.comwrote in message
    >
    news:ee9cd3be08 05080902g48e641 bxbcf1d5578620d efe@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.

    Comment

    Working...