加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – PermissionError:[Errno 13]权限被拒绝

发布时间:2020-12-14 04:20:00 所属栏目:Windows 来源:网络整理
导读:我收到这个错误: Exception in Tkinter callbackTraceback (most recent call last):File "C:Python34libtkinter__init__.py",line 1538,in __call__return self.func(*args)File "C:/Users/Marc/Documents/Programmation/Python/Llamachat/Llamachat/L
我收到这个错误:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:Python34libtkinter__init__.py",line 1538,in __call__
return self.func(*args)
File "C:/Users/Marc/Documents/Programmation/Python/Llamachat/Llamachat/Llamachat.py",line 32,in download
with open(place_to_save,'wb') as file:
PermissionError: [Errno 13] Permission denied: '/goodbye.txt'

运行时:

def download():
    # get selected line index
    index = films_list.curselection()[0]
    # get the line's text
    selected_text = films_list.get(index)
    directory = filedialog.askdirectory(parent=root,title="Choose where to save your movie")
    place_to_save = directory + '/' + selected_text
    print(directory,selected_text,place_to_save)
    with open(place_to_save,'wb') as file:
        connect.retrbinary('RETR ' + selected_text,file.write)
    tk.messagebox.showwarning('File downloaded','Your movie has been successfully downloaded!' 
                              'nAnd saved where you asked us to save it!!')

有人能告诉我我做错了什么吗?
谢谢

眼镜 :
Python 3.4.4 x86
Windows 10 x64

更改要保存的目录的权限,以便所有用户都具有读写权限.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读