Hi All,

Can someone tell me how to redirect stderr back to the console once
you've moved it?

import os,sys
se = os.open("/tmp/mod.log", os.O_WRONLY|os.O_APPEND|os.O_CREAT)
sys.stderr.write("Foobar\n")
Foobar
os.dup2(se, 2)

cmds = os.popen("ls alaksjdf")

<Now what do I need to do here to make this come back?>

sys.stderr.write("Foobar\n")
Foobar

Any ideas?  Thanks



--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to