Noir
Posts: 1
Joined: Sun Aug 24, 2014 3:22 am

Run python after boot

Sun Aug 24, 2014 3:34 am

i have one script of python (with selenium) and i have one of script for run after startx gui
it not work on screen as i connect with raspberry pi (browser not automatic show)
but the python script complete work on my remote screen

# app.desktop
[Desktop Entry]
Encoding = UTF-8
Type=Application
Name=App
Comment=Start Application
Exec=sleep 10; sudo python script.py
StartupNofitfy=false
Ternimal=false
Hidden=false

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: Run python after boot

Sun Aug 24, 2014 7:20 am

If you put

Code: Select all

/usr/bin/python /full/path/to/script.py &
in /etc/rc.local (before the exit 0) it should run your script as root every time the Pi boots.
(edit /full/path/to/ as needed, probably /home/pi)

Return to “Beginners”