...使用AttributeError的: 'CalledProcessError' 對象有沒有屬性 '輸出'
- 比較新的Linux(< 1年)的自動密鑰0.81.4在Ubuntu 10.04
- 這是第一個Python我已寫入
以下用於AutoKey的腳本會因以下錯誤而失敗。我不在這裏?
Script name: 'find files script'
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/autokey/service.py", line 442, in execute
exec script.code in self.scope
File "<string>", line 13, in <module>
AttributeError: 'CalledProcessError' object has no attribute 'output'
腳本
import time
time.sleep(0.10)
retCode, args = dialog.input_dialog("Files to Find","enter a file name")
fmt = "find/-name \"{0}\" -type f -print 2>/dev/null "
if retCode == 0:
if len(args) > 0:
cmd = fmt.format(args)
#dialog.info_dialog(title="the command",message=cmd)
try:
rc = system.exec_command(cmd, getOutput=True)
except subprocess.CalledProcessError, e:
dialog.info_dialog(title="the return",message=str(e.output))
什麼模塊是system.exec_command從? – soulcheck 2012-01-08 05:08:45