python redirect stdout stderr to file