python write stdout and stderr to file