标签:core reading pytho pre mod mode txt int 处理
myFile=open("score.txt",‘w‘) print("Name "+myFile.name) print("Mode "+myFile.mode) myFile.write("GBJ: 100\nKHD : 99\nBBB :89") myFile.close() #Read the file myFile2=open("score.txt",‘r‘) print("Reading...\n" + myFile2.read(8)) #read 10 myFile2.seek(0) #重新设置起始位置,在这里等同于myFile2.close() print("Reading again..." + myFile2.read(8))
标签:core reading pytho pre mod mode txt int 处理
原文地址:http://www.cnblogs.com/uxiuxi/p/7675378.html