如何在Applescript中运行python脚本? [英] How to run a python script inside Applescript?

查看:252
本文介绍了如何在Applescript中运行python脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不得不做一个Applescript,最后我只想运行一个python脚本.

I had to do an Applescript and by the end of it i just want to run a python script.

我写了

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

但是有人说权限被拒绝"

But it's said "permission denied"

有什么主意吗?

推荐答案

您正在尝试直接运行脚本,而不是使用Python来运行它.您需要执行shell脚本python,并将路径作为参数传递给脚本.

You are trying to run the script directly instead of using Python to run it. You need to do shell script python, passing the path to your script as an argument.

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

这篇关于如何在Applescript中运行python脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆