Quantcast
Channel: Pimoroni Buccaneers - Latest posts
Viewing all articles
Browse latest Browse all 53849

Dot3k menu example - code to halt/reboot the Pi?

$
0
0

My usual setup for triggering a script is to create a startup file that changes into the correct directory and then launches the Python script with sudo. It would look something like this:

start.sh

#!/bin/bash
cd /home/pi/.../advanced/
sudo python menu.py

Or to make it vehemently keep menu.py running, I sometimes use this:

#!/bin/bash
cd /home/pi/.../advanced/
while [ 1 ]; do sudo python menu.py; sleep 1; done

Then I run this script by adding it to /etc/rc.local


Viewing all articles
Browse latest Browse all 53849

Trending Articles