Hi I am trying to autostart a python script . I have edited the rc.local file to add the file location before exit 0..
sudo python /home/pi/myscript.py &
The myscript.py has executable permission . But the python script doesnt run .
I have also tried to add the file to .bashrc but when raspi is rebooted the sccript does not start . But when i connect to raspi using putty terminal from ubuntu machine ..i get a
tkinter.Tclerror: no display name and no $DISPLAY environmental variable error
..which is usually what get when i run the script from putty ..
sudo
inrc.local
, init runs it with privileges anyway. Note you can't start a graphical app that way; if you want to replace the GUI login at boot that's a complex task. If you want to start it in a desktop session at normal login, see here. WRTssh
, tryexport $DISPLAY=:0
but that will start the app on the display connected to the pi, not your ssh terminal. – goldilocks Aug 04 '15 at 13:55