84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
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
什么情况呢?
闭关修行中......
Your python version should be 2.X, right? Please try changing 'rw' in the permissions section to 'r+'
As long as you bring the + sign, you will have various permissions.
rw cannot be recognized. If you want to have both read and write permissions, you can change it to ab+
It is recommended to use with to improve code readability
Your python version should be 2.X, right? Please try changing 'rw' in the permissions section to 'r+'
As long as you bring the + sign, you will have various permissions.
rw cannot be recognized. If you want to have both read and write permissions, you can change it to ab+
It is recommended to use with to improve code readability