【发布时间】:2012-01-08 04:29:11
【问题描述】:
...在 Ubuntu 10.04 上使用 AutoKey 0.81.4
- 对 Linux 比较陌生(
- 这是我写的第一个 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 来自哪个模块?