[python] PermissionError: [Errno 13] in 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.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\

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

NOTE: not sure how Python and Windows files work but I'm logged in to Windows as Admin and the folder has admin permissions.

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

This question is related to python python-3.x

The answer is


For me, I was writing to a file that is opened in Excel.


I encountered this problem when I accidentally tried running my python module through the command prompt while my working directory was C:\Windows\System32 instead of the usual directory from which I run my python module