maybe you can try replaceing sys.stdout and/or sys.stderr with a just a simple file? then everything will be written to that file instead of desplayed on the console. Cheers, Ido.