"fork and exit" needed?

Vincent Delporte justask at acme.com
Tue Nov 28 19:42:10 EST 2006


On Tue, 28 Nov 2006 08:30:03 -0600, Nick Craig-Wood
<nick at craig-wood.com> wrote:
>>  import os,sys,time
>>  print "pre:", os.getpid()
>>  sys.stdout = open(os.devnull, 'w')
>>  print "post:", os.getpid()
>>  time.sleep(60)
>> 
>>  (Granted, I'm on WinXP; I also suspect the original stdout is still open
>>  in the background, maybe dualled with stderr?)
>
>Yes that is the point - the original stdout is still open.
>
>I don't think this discussion is relevant to windows though - windows
>has its own way of making daemons.

Thanks everyone. I'll see if the Python script runs OK in an Asterisk
PBX on Linux.



More information about the Python-list mailing list