I am trying to make the raspberry run my python script as soon as there is power supply. I have found some ways is to prepaire the rc.local file I did and i tried to execute the rc.local file alone it works but it doesn't work when I just plug in the power supply, nor when open the puTTY session even not when I open the lxsession (It doesnt run automatically in any of the cases) my rc.local
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. # Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi sudo python /home/pi/t3.py --cascade=/home/pi/s.xml 0 exit 0
sudois unnecessary (and does nothing asrc.localis running as root). Remove this and give it a try. It is also possible that something in the Python script is not running; probably because you are not logged in, or paths are not complete.