Re: [Tutor] how to run a process forever

2008-12-10 Thread Tiago Saboga
On Wed, Dec 10, 2008 at 11:29:10AM -0800, Steve Willoughby wrote: > On Wed, Dec 10, 2008 at 01:15:18PM -0600, shawn bright wrote: > > i am running this on a linux computer. How would i check that it is > > running? (from cron part) > > Typically you have your program write its PID to a file. The

Re: [Tutor] how to run a process forever

2008-12-10 Thread shawn bright
cool thanks for the help. -shawn On Wed, Dec 10, 2008 at 1:29 PM, Steve Willoughby <[EMAIL PROTECTED]> wrote: > On Wed, Dec 10, 2008 at 01:15:18PM -0600, shawn bright wrote: >> Sorry, was not very specific in my request. >> >> say i have a script like >> >> while 1: >> do_something_cool() >>

Re: [Tutor] how to run a process forever

2008-12-10 Thread Steve Willoughby
On Wed, Dec 10, 2008 at 01:15:18PM -0600, shawn bright wrote: > Sorry, was not very specific in my request. > > say i have a script like > > while 1: > do_something_cool() > time.sleep(2) Ah, ok. First of all, my preference would be to say "while True:" there, seems more clear to me. A

Re: [Tutor] how to run a process forever

2008-12-10 Thread shawn bright
Sorry, was not very specific in my request. say i have a script like while 1: do_something_cool() time.sleep(2) i am running this on a linux computer. How would i check that it is running? (from cron part) and how do i kick it off when i boot the computer? ( the init script part) thanks

Re: [Tutor] how to run a process forever

2008-12-10 Thread W W
while True: is also a common way to make your program "run forever". Although you still need to create some sleep/wait function or it will eat up your available processes (so I'm told). -HTH, Wayne On Wed, Dec 10, 2008 at 12:28 PM, Steve Willoughby <[EMAIL PROTECTED]>wrote: > On Wed, Dec 10, 200

Re: [Tutor] how to run a process forever

2008-12-10 Thread Steve Willoughby
On Wed, Dec 10, 2008 at 12:23:48PM -0600, shawn bright wrote: > Hey gents, > > I have an interesting problem. I need to have a python script start > when a computer boots up, and i need it to run forever. > I also am going to run a script by cron that will check to see if the > process is running,

[Tutor] how to run a process forever

2008-12-10 Thread shawn bright
Hey gents, I have an interesting problem. I need to have a python script start when a computer boots up, and i need it to run forever. I also am going to run a script by cron that will check to see if the process is running, if not, i need a python script to execute the script. What would be a go