file_object = open(r"/root/py_test/web01/src/ftime",'rw')
try:
print file_object.read()
file_object.write('test')
finally:
file_object.close( )
读取一个文件,内容就一行
然后再写入,报错。
IOError
IOError: [Errno 9] Bad file descriptor
什么情况呢?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…