Added stdout redirection within Python.