f = open(path, 'w') f.write(self.str) f.close()
IOError: [Errno 13] Permission denied: 'output.txt'
没有权限写文件,比较蠢的解决方法
sudo chmod 777 <file_name>