Shutdown/reboot push button for Raspberry Pi

Copy unplug.py to /home/pi

 

use this command

sudo nano /etc/rc.local

 

to add

sudo python /home/pi/unplug.py &

 

to file  /etc/rc.local before the line

exit 0