echo "Denied" > log.txt
由shell腳本創建的文件不是由python打開的?
後的log.txt在Python打開:
def read_file(logs,self):
print 'here'
f1=open(logs,"r","utf-8")
for line in f1:
print str(line)
在運行提示錯誤:
"TypeError: coercing to Unicode: need string or buffer, instance found"
什麼是'self' for? – joaquin 2012-01-08 22:00:18