2016-06-05 with文 Python2 ファイルのオープンとクローズなどをシンプルに書ける。 with open("text.txt", 'w') as file: file.write("Hello Yoshida")