Should python script files be executable?
<p>Should python script files be executable?</p>

<p>Suppose I'm developing a small tool. I have the following files:</p>

<pre><code>my_tool.py
my_lib.py
my_other_lib.py
....
</code></pre>

<p>Occasionally I run my tool with <code>python my_tool.py</code>.</p>

<p>Is there a convention that the first file should be executable, while all "libraries" should not be? If I have multiple entry points, should all of them be marked executable?</p>

<p>You only need to make a python script executable if it has a hashbang at the top.  Python doesn't require that <a href="http://docs.python.org/tutorial/modules.html" rel="nofollow">modules</a> you intend to import or any scripts passed as arguments are flagged as executable.</p>

<p>As for naming conventions, you should only flag files that actually have the hashbang in them as executable.  And if you want to better separate the modules from the executables, you should use directories as specified in section 6.4 of the <a href="http://docs.python.org/tutorial/modules.html" rel="nofollow">module tutorial</a>.</p>

python naming-conventions