其他分享
首页 > 其他分享> > io.UnsupportedOperation: not readable

io.UnsupportedOperation: not readable

作者:互联网

两处错误
一、你是用open打开一个文件,此时调用的是w写入模式,下面使用read是没有权限的,你得使用w+读写模式
二、使用write写入一个字符s,但是此时并没有真正的写入,而是还存在与内存中。此时执行read读取的为空字符。需要执行a.close()以后,再使用a=open(“D://2.txt”)
a.read()才能够读取到数据。

标签:UnsupportedOperation,读取,read,写入,readable,io,使用,此时,open
来源: https://www.cnblogs.com/longfei825/p/15334394.html