We'll learn how to Auto Run Python Program on Startup. In the end, we'll Power-up Raspberry Pi using Power Bank to automate running python script on boot. We can learn how stand alone product run python program. So we don't need to use terminal and run python script manually.
How to run a python script on Raspberry Pi Boot (4-STEP PROCESS)
sudo raspi-config
Select “Boot Options” then “Desktop/CLI” then “Console Autologin”
In the command prompt or in a terminal window type:
sudo nano /etc/profile
Scroll to the bottom and add the following line
sudo python /home/pi/brightness.py &
where “/home/pi/brightness.py” is the path to your script.
Type “Ctrl+X” to exit, then “Y” to save followed by “Enter” twice.
sudo reboot
On this page of the site you can watch the video online Auto Run Python Program on Raspberry Pi4 Startup using Battery (Power Bank) with a duration of online in good quality, which was uploaded by the user BINARYUPDATES 27 March 2020, share the link with friends and acquaintances, this video has already been watched 39,904 times on youtube and it was liked by 604 viewers. Enjoy your viewing!