Run python program on start-up

Problem:
You need to run a python program or report once raspberry pi start-up.

Solution:
You can do this editing you rc-local file, you add the next entry and pay especial attention on bash method to ensure that you run the program with the specific software version.


sudo bash -c '/usr/bin/python3 /home/pi/progra.py > /home/pi/log.txt 2>&1' &
Light  Explanation:
sudo allow you to run the program with admin privilege, 
bash allow to specify the software version pf pyhton
> create a file with the result of the program execution


Remember that the rc.local fine need to end with a exit 0 in the final line