Running a Python Program on boot with the Raspberry Pi
One of the most common questions asked about the Raspberry Pi is how to get code you wrote to run automatically as soon as you boot it up. We get why this question is so common; a lot of people have entered this world of open electronics by way of the Arduino, and simply giving it power will start it up and run your code. With the Pi, there is a lot more going on so in this tutorial we will show you how to get your code up and running automatically as soon as the Pi starts.
There are a lot of different operating systems out there for the Raspberry Pi, so we are going to focus on the most popular: Raspbian. We are using the version dated: 2018-06-27 deviating from this may result in different / additional steps so if you are very new to this, we recommend following the tutorial exactly. Please Note: This will not work on the Lite version of Raspbian.
If you have any questions, or need further clarification please post in the comments section below; this way future users of this tutorial can see the questions and answers!