How to make Python executable on Mac?

My search query failed. I would like to know how to make a Python executable on OS X, that is, how to make a .exe file that can run a Python script with a double click (and not from the shell). In this regard, I assume that the solution for this would be the same for different scripting languages, is that so?

+4
source share
2 answers

To make a script executable (e.g. Python) executable from the shell, you must include the so-called hash bang line as the first line of the file (adjust your location of the binary python):

#!/usr/local/bin/python

, , , . chmod u+x <name_of_the_script.file>.

.

./<name_of_the_script.file>
+5

python OS X. python script , python path_to_my_script/my_script.py

+1

All Articles