简体   繁体   English

如何在Applescript中运行python脚本?

[英]How to run a python script inside Applescript?

I had to do an Applescript and by the end of it i just want to run a python script. 我不得不做一个Applescript,到最后我只想运行一个python脚本。

I wrote 我写

do shell script "/Users/Tom/Desktop/ayscript.py"

But it's said "permission denied" 但据说“许可被拒绝”

Any idea ? 任何的想法 ?

You are trying to run the script directly instead of using Python to run it. 您正在尝试直接运行脚本,而不是使用Python来运行它。 You need to do shell script python , passing the path to your script as an argument. 你需要做shell脚本python ,将路径作为参数传递给你的脚本。

do shell script "python /Users/Tom/Desktop/ayscript.py"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM