# 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:

```bash
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](https://en.wikipedia.org/wiki/Shebang_(Unix)):

1. Make the file executable using `chmod` (make sure you consider which users/groups should be permitted to do this, obviously)
    
2. Append `#!/bin/python3` to the start of the file
    
    ```python
    #!/bin/python3
    print("Hello World");
    ```
    
3. Execute the file
    
    ```bash
    chris@chris-book:~$ ./hello-world.py
    Hello World
    ```
    

Keep in mind that you can do this with other program files too.
