結果 : write output of function to file python