[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Do any one know how to make a daemon in python
- To: "Development Discussions" <developer at arabeyes dot org>
- Subject: Re: Do any one know how to make a daemon in python
- From: "moayyad sadi" <alsadi at gmail dot com>
- Date: Mon, 24 Dec 2007 09:22:55 +0200
> In Python, you can use os.fork() and os.setsid() which are the substitutes
> of C's fork() and setsid() (of course, you need to import os library).
>
>
I tried that
it did not work,
I write a small script that do
from os import *
from time import * # or something like that
def loop():
for i in xrange(65000): print i; sleep(i)
#main
p=fork()
if p==0: loop()
else: print "this is the parent, child pid=%d\ndone\n" % p
and when I run it then close the terminal then open another one and type
ps ax | grep python
it did not appear
while the same code in C works
> http://homepage.hispeed.ch/py430/python/daemon.py
>
please send it to my email as an attachement, I don't have internet
please,