python - python没有用shell脚本执行
问题描述
我在 Anki Vector 机器人上通过 Alexa 使用 IFTTT。IFTTT 向我的计算机发送一个文本文件,launchd 正在监视该文件夹是否有任何更改。当它检测到更改时,会调用一个 shell 脚本。虽然我可以看到 shell 脚本的其他部分执行,但没有调用 python 脚本。当我从命令行执行 shell 脚本时,它会正确运行并执行两个 python 脚本。
我尝试更改 shell 脚本的权限。我尝试了各种调用 python 脚本的方法。
#!/bin/bash
#!/bin/sh
# My example bash script
#osascript -e 'tell app "System Events" to display dialog "Hello World"'
cd /Users/fancher/Development/anki_vector_sdk_examples_0.5.1/tutorials/
python3 /Users/fancher/Development/anki_vector_sdk_examples_0.5.1/tutorials/01_hello_alexis.py
python3 /Users/fancher/Development/anki_vector_sdk_examples_0.5.1/tutorials/01_hello_world.py
sleep 3
rm -f /Users/fancher/Dropbox/Vector/Test2.txt
rm -f /Users/fancher/Dropbox/Vector/.DS_Store
echo success!
#osascript -e 'tell app "System Events" to display dialog "trap point"'
当我从命令行执行此操作时,它可以工作 - 使用“hello_alexis.py”中的自定义文本和教程中的“hello_world”中的自定义文本进行响应。当它被 launchd 调用时,.txt 文件被删除,但没有执行 python 脚本。系统为 MacOS 10.14.2。Z 在 MacOS 中报告为非法选项。在 ls 中使用 -@ 所有文件都有 com.apple.quarantine。使用 xattr 删除。chmod 使所有可执行文件。仍然没有喜悦。看着控制台,我收到这些报告 2 月 5 日 08:01:56 MacBFancher com.apple.xpc.launchd[1] (com.fancher.Vector_dance.):服务只运行了 3 秒。将重生时间推迟 7 秒。2 月 5 日 08:05:40 MacBFancher com.apple.xpc.launchd[1] (com.apple.imfoundation.IMRemoteURLConnectionAgent):整数的未知键:_DirtyJetsamMemoryLimit
解决方案
推荐阅读
- javascript - 如何检查实时数据库firebase中是否存在值
- typescript - Typescript 可以强制执行类类型吗?
- python-3.x - azure container_client delete_blob 导致 oom
- r - R data.table 中涉及查看其他列的复杂总和
- javascript - jquery json显示未定义的html表解析
- google-apps-script - 我想将不同文档中的多个段落放在我文档中的占位符处
- apache-kafka - Spring boot Kafka 请求-回复场景
- nearprotocol - 如何针对具有多个合同的本地网络运行 Near-js-api 测试
- python - 读入并将多个文件合并或合并到公共 ID 列上的一个数据帧中
- .net-core - log4net:错误无法创建类型为 [log4net.Appender.ColoredConsoleAppender] 的 Appender [Console]。报告错误