做的时候
a_file = open('E:Python Win7-64-AMD 3.3Test', encoding='utf-8')…您正在尝试以文件形式打开 目录 ,这可能会(并且在大多数非UNIX文件系统上会)失败。
但是您的另一个示例;
a_file = open('E:Python Win7-64-AMD 3.3Testa.txt', encoding='utf-8')如果您获得的许可,则应该可以正常运行
a.txt。不过,您可能要使用原始(-
r前缀)字符串,以确保您的路径中不包含任何转义字符,这样
n会将其转换为特殊字符。
a_file = open(r'E:Python Win7-64-AMD 3.3Testa.txt', encoding='utf-8')


![PermissionError:[Errno 13]在python中 PermissionError:[Errno 13]在python中](http://www.mshxw.com/aiimages/31/626257.png)
