0
I wrote a simple python script
print("hey there")
which I execute with this code in the Terminal app:
python3.5 script.py
I've read that you can preface Python scripts with a hashbang and path to python, and than chmod +x script.py
to make it executable binary.
So my script now looks like this:
#! /usr/local/bin/python3.5
print("hey there")
I can still run the script with python3.5
command. I can also use ./script.py
, but I am not sure of what the benefit is with this approach. What is the benefit of using hasbang and chmoding a python script?