[Tutor] A couple of queries ...

Dave S pythontut at pusspaws.net
Tue Mar 16 13:14:49 EST 2004


Alan Gauld wrote:

>>Is there a python equiverlant of BASH "sleep xm". Ie halt, go to
>>    
>>
>sleep
>  
>
>>for x mins (Without resorting to a for loop with a v.large count,
>>inaccurate + eats CPU cycles!) ?
>>    
>>
>
>Yes, its:
>
>time.sleep(x*60)  # sleep takes seconds as an argument
>
>  
>
>>Second query. Is it possible for a python program to start up as a
>>background process? The app I am writting needs a demon... (see
>>    
>>
>query
>  
>
>>above :-) ) Rather than writting a seperate BASH script to call the
>>python script with "proggy.pg &" in it. This would work but seems a
>>    
>>
>bit
>  
>
>>awkward.
>>    
>>
>
>Have you tried just doing
>
>proggy.py &
>
>In other words why use a bash script?
>
>If you need the formal daemon treatment complete with funny ownerships
>and flags etc then there is a how-to page on the web somewhere...
>
>Alan G.
>
>  
>

Thanks for your help, it is much appreciated

Dave



More information about the Tutor mailing list