f = open("write.txt","w") f.write("This is to write using python! ") f.write("222 This is to write using python!") f.close() f = open("write.txt","r") for row1 in f: print row1 f.close() import os os.remove("write.txt") import os.path if os.path.isfile("postData"): os.remove("postData") <==存在していたら消す。 -------------------------------output--------------------- $ python read_write.py This is to write using python! 222 This is to write using python!