剛剛開始學習一些Python,我有作爲規定如下問題:PermissionError:[錯誤13]在Python
a_file = open('E:\Python Win7-64-AMD 3.3\Test', encoding='utf-8')
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
a_file = open('E:\Python Win7-64-AMD 3.3\Test', encoding='utf-8')
PermissionError: [Errno 13] Permission denied: 'E:\\Python Win7-64-AMD 3.3\\Test\
似乎是一個文件權限錯誤,如果任何一個可以發光一些光這將不勝感激。
注意:不確定Python和Windows文件如何工作,但我以管理員身份登錄到Windows,並且該文件夾具有管理權限。
我試過更改.exe
屬性以Admin身份運行。
是'Test'文件還是文件夾? –
@JoachimIsaksson這絕對是一個文件夾,我們可以在錯誤行結束時看到它。做出答案。 –
測試是一個文件夾,Document im下面的讀取我可以使用以下語法打開文本文檔a_file = open('E:\ Python Win7-64-AMD 3.3 \ Test \ a.txt',encoding ='utf-8 ')使用這個語法以及a_file = open('E:\ Python Win7-64-AMD 3.3 \ Test',encoding ='utf-8')給了我同樣的錯誤。 – BenniMcBeno