<p>我只想把我的脚本作为一个应用程序。双击并运行,而不是在终端中运行。我以前用过自动机,但现在,在埃尔卡皮坦,它不起作用。它只会给出错误而没有解释。</p>
<p>当我尝试使用automator时,会出现以下错误:</p>
<pre><code>"The action “Run Shell Script” encountered an error."
</code></pre>
<p>我也试过下面的把戏,还是做不到。</p>
<pre><code>#!/usr/bin/env python
chmod +x script.py
</code></pre>
<blockquote>
<blockquote>
<p>SOLVED:</p>
<p>After these two steps. I changed "Open with" to terminal for only this
file and changed the <code>#!/usr/bin/env python</code> , it works. But it doesn't work without the two steps below, you need to follow all
steps. </p>
</blockquote>
<p>在代码开头添加<code>#!/usr/local/bin/python</code>。那就跑吧
<code>chmod +x myscript.py</code>在终端。之后更改应用程序
打开到终端。</p>
<p>这对我有效。</p>
</blockquote>