[Tutor] A way to restart a script after it runs?

nik my.mailing.lists at noos.fr
Thu Oct 21 11:59:52 CEST 2004

This is a bit of a diversion from the original question, but I've always 
wondered how the duration of that sleep makes a difference -I've always 
used 1s, and it's kept the CPU happy, but if was 10ms would that work 
just as well? It must depend on how long the process takes before it 
calls the sleep and how many other processes are working hard as well, 
or does it?

Is there any way of balancing the CPU load, like some kind of dynamic sleep?


Shitiz Bansal wrote:

> I have done it by using while(1) loop many times.
> it is usually helpful to insert a sleep()with appropriate interval at 
> the end of the script( inside the while loop) to avoid too much CPU usage.
> */Eric <eric at digitalert.net>/* wrote:
>     Hi, I'm wondering if there is a ways to restart a script once it
>     completes running, and then have it reexecute frorm the beginning
>     again?
>     I figure there is most likely multiple ways to do this, but I have
>     not
>     been able to find anything other than this..
>     http://www.entrian.com/goto/
>     "*The "goto" module was an April Fool's joke, published on 1st April
>     2004. Yes, it works, but it's a joke nevertheless. Please don't
>     use it
>     in real code!*"**
>     So any suggestions?
>     _______________________________________________
>     Tutor maillist - Tutor at python.org
>     http://mail.python.org/mailman/listinfo/tutor
> ------------------------------------------------------------------------
> Do you Yahoo!?
> vote.yahoo.com <http://vote.yahoo.com> - Register online to vote today!
>Tutor maillist  -  Tutor at python.org

More information about the Tutor mailing list