完整报错为:io.UnsupportedOperation: not writable 解决方案 把原有的open('a.txt')改为open('a.txt', 'w')(覆写)或open('a.txt', 'a')(追加) 问题解析 这是因为没有权限