【问题标题】:How to run a python script in a shell script on MAC OS如何在 MAC OS 上的 shell 脚本中运行 python 脚本
【发布时间】:2018-10-02 18:22:53
【问题描述】:

当我在终端中运行 .sh 文件时,我正在尝试执行 .py 文件。但我收到此错误:/Users/Desktop/folder/script.sh: line 25: ./script_to_execute.py: Permission denied

我好像没有权限...我在mac os上

有什么想法吗?

提前谢谢

【问题讨论】:

  • chmod +x script_to_execute.py && ./script.sh

标签: python macos shell


【解决方案1】:

F.Leone 为您提供了解决问题的说明,只需为您的脚本添加执行权限。在终端执行:

chmod +x script_to_execute.py && ./script.sh

【讨论】:

    【解决方案2】:

    所以我尝试以这种方式执行它:eval $( ./Assemblage/info_planche.py -n "$num" )

    好的,它给了我这个:-rwxr--r--@ 用于 .sh 脚本和 -rw-r--r--@ 用于 .py 文件。

    谢谢

    【讨论】:

      最近更新 更多