1
f = open("test.txt",'r+')
print f.read();
f.write('\n\nI am carl wei.')
print f.read();
f.close()
寫一個文件,但它有一個eeror:Python中如何讀取和同時
Traceback (most recent call last):
File "C:\Users\carl.wei\workspace\Python\FileTest.py", line 9, in f.write('\n\nI am carl wei.') IOError: [Errno 0] Error
嗨,這裏已經解釋了。 http://stackoverflow.com/questions/14271216/beginner-python-reading-and-writing-to-the-same-file – theAlse
相關:[Python文件操作](http://stackoverflow.com/q/11176724/ 4279) – jfs