擅长:python、mysql、java
<p><a href="https://stackoverflow.com/questions/2429511/why-do-people-write-usr-bin-env-python-on-the-first-line-of-a-python-script/2429517#2429517">Add shebang line in the beginning your python script</a></p>
<pre><code>#!/usr/bin/env python
</code></pre>
<p>和<a href="http://effbot.org/pyfaq/how-do-i-make-a-python-script-executable-on-unix.htm" rel="nofollow noreferrer">make your python script executable</a>使用shell中的chmod。你知道吗</p>
<pre><code>chmod +x define_regions.py
</code></pre>
<p>然后您将能够像您试图实现的那样执行python脚本。你知道吗</p>
<p>添加shebang意味着人们可以根据需要直接调用脚本(假设它被标记为可执行);省略shebang意味着必须手动调用python。你知道吗</p>
<p>运行程序的最终结果不会受到任何影响;它只是方法的选择。你知道吗</p>