简体   繁体   English

IOError:[Errno 13]在Python中打开文件时权限被拒绝

[英]IOError: [Errno 13] Permission denied while opening a file in Python

I was trying to access a PDF file on Python and I get this message: 我试图在Python上访问PDF文件,并收到以下消息:

IOError: [Errno 13] Permission denied: 'C.pdf'

Here is a piece of code: 这是一段代码:

fPDF = open(self.filename, 'ab+')

This is the code which opens the file I have a Windows 64-bit PC with Python 2.7.9 installed 这是打开文件的代码,我有一台装有Python 2.7.9的Windows 64位PC

The error is pretty self-describing, the user that runs the python script does not have to rights to open the file. 该错误是自描述的,运行python脚本的用户无权打开文件。

Try running your app as administrator. 尝试以管理员身份运行您的应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM