I'm trying to make a python script and using tkinter and a solid-state relay controlled thru the GPIO. I can make the SSR go on or off both from using Idle and from terminal but when I put a 'QUIT' button on the same Tk frame as the 'ON' and 'OFF' buttons that work and try to use the 'command= 'stoppit' ' on the button, in order to stop the app and clear the display, I can't find the code to make it work. I use:-
Def stoppit():
GPIO.output(24,0)
GPIO.cleanup()
killall
Nothing happens when I click on 'QUIT'. I have tried 'from os import kill' and ' from sys import exit' at the top and instead of killall use exit(0), kill, pkill and any combinations I can find instead after searching the net for a couple of weeks, I'm giving up and and asking here if someone will tell me exactly what code to use?
As this will be the only working app, on all day, on this pi, I am hoping later to write a shell script to reload the py script daily if the 'QUIT' thing ends up needing almost anything short of a reboot and my intervention, as I travel away a lot and this is to control a pump for irrigation. tvm for any help here.