1. Add this shebang in the first line of your script:
2. Make it executable by changing directory to where the script is and running this in your terminal:
chmod +x name_of_script.py
You can check this worked by typing ./name_of_script.py in the directory and seeing if it runs.
3. edit (using nano) ~/.config/lxsession/LXDE-pi/autostart to include the line:
Now type, in your terminal, “reboot” to test.