結果 : write terminal output to file python