13 lines
191 B
Python
13 lines
191 B
Python
import signal
|
|
|
|
|
|
def _cleanup(*args, **kwargs):
|
|
import sys
|
|
import RPi.GPIO as gpio
|
|
gpio.cleanup()
|
|
sys.exit(0)
|
|
|
|
|
|
def setup_cleanup():
|
|
signal.signal(signal.SIGINT, _cleanup)
|