View shutdown.py
import RPi.GPIO as GPIO
import os
BUTTON_PIN = 14
GPIO.setmode(GPIO.BCM)
GPIO.setup(BUTTON_PIN, GPIO.IN)
try:
channel = GPIO.wait_for_edge(BUTTON_PIN, GPIO.RISING)