hello, On Mon, Oct 03, 2011 at 04:37:43AM +0000, Steven D'Aprano wrote: > > I wanted to ensure that it would do the right thing when run without a tty, > such as from a cron job.
If you fork() your process, then it will also loose the tty...
import os
import sys
try:
pid = os.fork()
if pid > 0:
sys.exit(0)
except OSError, e:
sys.exit(1)
os.chdir("/")
os.setsid()
os.umask(0)
a.
--
http://mail.python.org/mailman/listinfo/python-list
