How do I make damon process in Python ?

Carsten Gaebler cg at schlund.de
Fri Feb 23 04:39:03 EST 2001


iact21 wrote:
> How can I make damon process in Python..?
> 
> I'd like to see example code...

#!/usr/bin/python 

import os

pid = os.fork()
if pid == 0:
        # Child process (daemon)
        while 1:
                pass
else:
        # Parent process:
        # Do something useful, or nothing, then exit
        # and leave the child alone.
        pass



cg.
-- 
Carsten Gaebler                    Computerhomoeopathie und
Schlund + Partner AG                  Schlangenbeschwoerung
Erbprinzenstr. 4 - 12             voice://49.721.91374.543/
76133 Karlsruhe                     fax://49.721.91374.228/



More information about the Python-list mailing list