本人python新生来问个问题

img


有没有人来帮助本人,就是个修改文件的程序不知道哪里有问题,系统是macos

f1= open('/path/name','r', encoding='UTF-8')

或者

f1= open('/path/name','r', encoding='GBK')
指定一下编码格式估计就好了

f1= open('/path/name','rb+')
试试,应该是读不了2进制报错的