目前,如果我使用 Run shell script
并在那里启动 python 脚本:
/usr/bin/python /Users/myuser/script.py "$1"
如果由于发生异常而导致脚本执行失败,Automator 将返回错误,但什么也没说:
Run Shell Script failed - 1 error
Traceback (most recent call last):
有什么方法可以运行 shell 脚本来查看所有调试消息(或者,运行终端并在那里运行 python 脚本)?
最佳答案
我相信您最好的前进方式是使用 Python 调试器:
import pdb
pdb.set_trace()
在你的 py 脚本中。
更多信息在这里:
关于python - 如何使用 Automator 运行 python 脚本以查看调试/错误消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23359901/