<small id='ylii6'></small><noframes id='ylii6'>

  • <legend id='ylii6'><style id='ylii6'><dir id='ylii6'><q id='ylii6'></q></dir></style></legend>

    <tfoot id='ylii6'></tfoot>

      <bdo id='ylii6'></bdo><ul id='ylii6'></ul>

      1. <i id='ylii6'><tr id='ylii6'><dt id='ylii6'><q id='ylii6'><span id='ylii6'><b id='ylii6'><form id='ylii6'><ins id='ylii6'></ins><ul id='ylii6'></ul><sub id='ylii6'></sub></form><legend id='ylii6'></legend><bdo id='ylii6'><pre id='ylii6'><center id='ylii6'></center></pre></bdo></b><th id='ylii6'></th></span></q></dt></tr></i><div id='ylii6'><tfoot id='ylii6'></tfoot><dl id='ylii6'><fieldset id='ylii6'></fieldset></dl></div>

        PermissionError:Python 中的 [Errno 13]

        时间:2024-04-21

      2. <i id='MTvKw'><tr id='MTvKw'><dt id='MTvKw'><q id='MTvKw'><span id='MTvKw'><b id='MTvKw'><form id='MTvKw'><ins id='MTvKw'></ins><ul id='MTvKw'></ul><sub id='MTvKw'></sub></form><legend id='MTvKw'></legend><bdo id='MTvKw'><pre id='MTvKw'><center id='MTvKw'></center></pre></bdo></b><th id='MTvKw'></th></span></q></dt></tr></i><div id='MTvKw'><tfoot id='MTvKw'></tfoot><dl id='MTvKw'><fieldset id='MTvKw'></fieldset></dl></div>

              <small id='MTvKw'></small><noframes id='MTvKw'>

              <legend id='MTvKw'><style id='MTvKw'><dir id='MTvKw'><q id='MTvKw'></q></dir></style></legend>
              • <bdo id='MTvKw'></bdo><ul id='MTvKw'></ul>
                  <tbody id='MTvKw'></tbody>
              • <tfoot id='MTvKw'></tfoot>
                  本文介绍了PermissionError:Python 中的 [Errno 13]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  刚开始学习一些 Python,我遇到了如下所述的问题:

                  Just starting to learn some Python and I'm having an issue as stated below:

                  a_file = open('E:Python Win7-64-AMD 3.3Test', encoding='utf-8')
                  
                  Traceback (most recent call last):
                    File "<pyshell#9>", line 1, in <module>
                      a_file = open('E:Python Win7-64-AMD 3.3Test', encoding='utf-8')
                  PermissionError: [Errno 13] Permission denied: 'E:\Python Win7-64-AMD 3.3\Test
                  

                  似乎是文件权限错误,如果有人能发光,将不胜感激.

                  Seems to be a file permission error, if any one can shine some light it would be greatly appreciated.

                  注意:不确定 Python 和 Windows 文件如何工作,但我以管理员身份登录到 Windows,并且该文件夹具有管理员权限.

                  我已尝试将 .exe 属性更改为以管理员身份运行.

                  I have tried changing .exe properties to run as Admin.

                  推荐答案

                  什么时候做;

                  a_file = open('E:Python Win7-64-AMD 3.3Test', encoding='utf-8')
                  

                  ...您正在尝试将 目录 作为文件打开,这可能(并且在大多数非 UNIX 文件系统上)会失败.

                  ...you're trying to open a directory as a file, which may (and on most non UNIX file systems will) fail.

                  你的另一个例子;

                  a_file = open('E:Python Win7-64-AMD 3.3Testa.txt', encoding='utf-8')
                  

                  如果您只有 a.txt 的权限,应该可以正常工作.您可能希望使用原始(r-prefixed)字符串,以确保您的路径不包含任何转义字符,如 将被转换为特殊字符.

                  should work well if you just have the permission on a.txt. You may want to use a raw (r-prefixed) string though, to make sure your path does not contain any escape characters like that will be translated to special characters.

                  a_file = open(r'E:Python Win7-64-AMD 3.3Testa.txt', encoding='utf-8')
                  

                  这篇关于PermissionError:Python 中的 [Errno 13]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:TypeError:在字符串格式化python期间并非所有参数都转换了 下一篇:TypeError:需要一个类似字节的对象,而不是 python 和 CSV 中的“str"

                  相关文章

                  <small id='7Z70G'></small><noframes id='7Z70G'>

                  1. <legend id='7Z70G'><style id='7Z70G'><dir id='7Z70G'><q id='7Z70G'></q></dir></style></legend>

                    <i id='7Z70G'><tr id='7Z70G'><dt id='7Z70G'><q id='7Z70G'><span id='7Z70G'><b id='7Z70G'><form id='7Z70G'><ins id='7Z70G'></ins><ul id='7Z70G'></ul><sub id='7Z70G'></sub></form><legend id='7Z70G'></legend><bdo id='7Z70G'><pre id='7Z70G'><center id='7Z70G'></center></pre></bdo></b><th id='7Z70G'></th></span></q></dt></tr></i><div id='7Z70G'><tfoot id='7Z70G'></tfoot><dl id='7Z70G'><fieldset id='7Z70G'></fieldset></dl></div>

                    <tfoot id='7Z70G'></tfoot>

                      • <bdo id='7Z70G'></bdo><ul id='7Z70G'></ul>