【发布时间】:2021-08-23 10:38:36
【问题描述】:
我只是创建 test.py 文件并在其中编写以下代码。
open('test.jpg','wb')
我通过命令 Python test.py 运行它。然后我得到以下错误
Traceback (most recent call last):
File "test.py", line 2, in <module>
open('test.jpg','wb')
PermissionError: [Errno 13] Permission denied: 'img.jpg'
但是当我将扩展名更改为 .txt 时,它可以正常工作
open('test.txt','wb')
文件夹中不存在 test.jpg 和 test.txt
真正的问题是什么?
【问题讨论】:
标签: python node.js image file permissions