Python文件读取

f = open(path, 'w')
f.write(self.str)
f.close()

IOError: [Errno 13] Permission denied: 'output.txt'

没有权限写文件,比较蠢的解决方法

sudo chmod 777 <file_name>

原文地址:https://www.cnblogs.com/lebronzhang/p/6170019.html