import signal
import time
import os
import sys
def handle_int(sig, frame):
print("get signal: {}".format(sig))
sys.exit(0)
if __name__ == "__main__":
signal.signal(signal.SIGRTMIN + 0, handle_int)
print("The pid is {}".format(os.getpid()))
while True:
time.sleep(3)
Link to C
沒有留言:
張貼留言