4月 7th, 2008at 15:33
Tags: Python
Python2.5のファイル操作
#ファイルの書き込みw = open("./sample.txt", "w")
w.write("なんで")w.write("ダイワハウスなんだ\n")
list = ["なんで", "ダイワハウスなんだ\n"]w.writelines(list)
w.close()
実行結果(出力されたsample.txt)
なんでダイワハウスなんだなんでダイワハウスなんだ
4月 7th, 2008at 15:33
Tags: Python
#ファイルの書き込みw = open("./sample.txt", "w")
w.write("なんで")w.write("ダイワハウスなんだ\n")
list = ["なんで", "ダイワハウスなんだ\n"]w.writelines(list)
w.close()
実行結果(出力されたsample.txt)
なんでダイワハウスなんだなんでダイワハウスなんだ