Mitja Trampus [EMAIL PROTECTED] wrote:
Nick Craig-Wood wrote:
I'm not sure how you do open stdout to /dev/null in python though!
I suspect something like this...
import posix
posix.close(1)
posix.open(/dev/null, posix.O_WRONLY)
Yes, you're close enough... The explanations are
Nick Craig-Wood wrote:
open STDOUT, '/dev/null';
sys.stdout = open(os.devnull, 'w')
$ ls -l /proc/32004/fd
total 4
lrwx-- 1 ncw ncw 64 Nov 28 09:55 0 - /dev/pts/17
lrwx-- 1 ncw ncw 64 Nov 28 09:55 1 - /dev/pts/17
lrwx-- 1 ncw ncw 64 Nov 28 09:55 2 - /dev/pts/17
l-wx-- 1