Heim > Fragen und Antworten > Hauptteil
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
什么情况呢?