How to make python file executable in Mac terminal

0 votes
10 views
asked Nov 7 by ubuntu (106 points)

I am using Mac OS High Sierra, I have python file that I need to able to run via Mac terminal .
How can I do that.

1 Answer

0 votes
answered Nov 7 by basher (104 points)

to make python file executeable you have to execute following command in bash/terminal.

chmod +x python_file.py

and execute file via

./path/python_file.py

your file permission will be set to -rwxr-xr-x when you see it via ls -l

...