How do I run the following script in Raspberry pi 4 terminal as soon as it starts up?

21 Views Asked by At

I am currently running the program via VNC and after startup I open the terminal and run the following code

cd home/documents/......
source venv/bin/activate
python new.py 

as soon as i run this, the camera activates and the code to detect and announce what object is infront begins. So what do I need to do to run the same on start up? Also now every time I run the code, the whole raspberry just freezes and restarts, Is there any way to fix this?

I tried using the rc.local method and it doesnt work. Regarding the system freezing, I thought it was a space issue and tried clearing the wastebin which was kind of full but didnt work

1

There are 1 best solutions below

0
Rafae On