Python does not have permission to open .txt file
<p>Disclaimer This question might be a duplicate of a question I could not find by searching.</p>

<p>I am trying to open a .txt file I downloaded. I used:</p>

<pre><code>with open("spam.txt", "a+") as ef:
    #other code that works
</code></pre>

<p>and I am getting<code>IOError [Errno 13] Permission denied: 'spam.txt'</code></p>

<p>Is there something I did wrong or do I have to open the file a different way?</p>

<p>Edit: I checked and I do have all the read, write, and execute permissions for the file and I can open it on Notepad. I am using Windows as my OS.</p>