Skip to content

Instantly share code, notes, and snippets.

@mikeesto
Last active September 21, 2022 04:18
Show Gist options
  • Save mikeesto/84757517d2ef238d895479516b24f1ca to your computer and use it in GitHub Desktop.
Save mikeesto/84757517d2ef238d895479516b24f1ca to your computer and use it in GitHub Desktop.
Start a Python script on boot (Raspberry Pi 3)

Start a Python script on boot (Raspberry Pi 3)

This method will also work with any program, including those that require access to xorg

Edit the LXDE autostart file

/etc/xdg/lxsession/LXDE-pi/autostart

Append to the end of the file the command/script to run, for example:

@/usr/bin/python3 /home/pi/example.py

Reboot the Pi to run the script

sudo reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment