仅仅是为了Linux操作方便= =命令行最近没有时间仔细看看,电脑一直都在机房,暂且这般记着吧= =
spath="D:/download/baa.txt" f=open(spath,"w") # Opens file for writing.Creates this file doesn't exist. f.write("First line 1.\n") f.writelines("First line 2.") f.close() f=open(spath,"r") # Opens file for reading for line in f: print line f.close() raw_input("press any key to continue...")