I am trying to get a python code to run on boot on the raspberry pi. I added the following line to the .bashrc file at the end of the file:
sudo python3 /home/pi/code.py
The pi uses python2 to run the code instead of python3. Why is this happening and how can I make it run python3?
Thanks
.bashrcwill not be executed at boot, so whatever is starting your script at boot time using Python2 it is not the line you're looking at. – Dmitry Grigoryev Jan 27 '20 at 12:21#!/usb/bin/python2just fine. – Dmitry Grigoryev Jan 27 '20 at 12:24