IOError:[Errno 13]权限被拒绝:' /etc/wpa_supplicant/wpa_supplicant.conf'

时间:2014-05-29 17:17:34

标签: python python-3.x raspberry-pi permission-denied

我遇到问题:

for line in open("/etc/wpa_supplicant/wpa_supplicant.conf", mode="r", encoding="utf8"):
    print(line)

结果是:

  

IOError:[Errno 13]权限被拒绝:' /etc/wpa_supplicant/wpa_supplicant.conf'

什么是问题?

1 个答案:

答案 0 :(得分:1)

尝试:

sudo python [yourcode]

chmod 777 /etc/wpa_supplicant/wpa_supplicant.conf
python [yourcode]