我在Mac OS中有一個文件a.txt
,裏面有寫燙髮給大家:蟒蛇權限錯誤
sh-3.2# ls -hal a.txt
-rw-rw-rw- 1 root wheel 0B Dec 8 11:34 a.txt
sh-3.2# pwd
/var/root
但是在Python它給了我一個錯誤:
>>> fob=open("/var/root/a.txt","w")
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
fob=open("/var/root/a.txt","w")
IOError: [Errno 13] Permission denied: '/var/root/a.txt'
的問題:爲什麼?