Streamlining the execution of Python scripts

In recent months, I've been dabbling in a bit of Python. It's easy to get to grips with, and the syntax is clean. Closely following a variety of tutorials, I'd simply write some code in hello-world.py, then execute it like so:
chris@chris-book:~$ python3 hello-world.py
This would work, and I thought that's just how you ran the code. Anyway, while starting a new course, I just discovered that you can streamline this process using a shebang:
Make the file executable using
chmod(make sure you consider which users/groups should be permitted to do this, obviously)Append
#!/bin/python3to the start of the file#!/bin/python3 print("Hello World");Execute the file
chris@chris-book:~$ ./hello-world.py Hello World
Keep in mind that you can do this with other program files too.



