我想用参数“-s”运行IDLE3.2,这样它就可以读取“.pythonstartup”并导出相关模块,更改工作目录等等。下面是我尝试过的:
创建了一个shell脚本:
/usr/local/bin/idle3.2 -s
这很正常,但是从Finder运行脚本会打开终端,这不是期望的行为。
创建了applescript:
^{pr2}$但是,终端的getrids无法将“-s”参数传递给idle3.2,因此配置文件不会被加载。
有什么建议吗?在
编辑:即使调用了/bin/bash,环境变量也没有正确设置。因此,以下解决了这个问题:
do shell script "/bin/bash; source ~/.profile; /usr/local/bin/idle3.2 -s"
我认为你的
do shell script "/bin/bash; cd /usr/local/bin; ./idle3.2 -s"
是在做额外的工作,而且可能做得更简单。尝试:感谢@lain,下面的applescript解决了这个问题:
其中~/.profile为shell(在本例中为/bin/sh)指向.PYTHONSTARTUP的路径和idle3.2的路径
相关问题 更多 >
编程相关推荐