如果读者需要传输单个文件(如:照片文件),使用一下代码会有一个拒绝访问的权限错误,可以考虑按照下列修改代码。
shutil.copyfile(os.path.join(dir_path, file_name)), out)
报错信息如下:
D:\Anaconda3\envs\Paddle-Vision2_1\python.exe D:/PyCharm/Deployment/deploy/test.py
Traceback (most recent call last):
File "D:/PyCharm/Deployment/deploy/ww.py", line 14, in <module>
shutil.copyfile(os.path.join(dir_path, file_name), out)
File "D:\Anaconda3\envs\Paddle-Vision2_1\lib\shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'testIMG/'
Process finished with exit code 1
转换为如下代码
shutil.copyfile(os.path.join(dir_path, file_name)), out)
因为不能放截图成功的日志当然是什么都没有 ^_^
D:\Anaconda3\envs\Paddle-Vision2_1\python.exe D:/PyCharm/Deployment/deploy/test.py
Process finished with exit code 0
|