[Python] Create thread, and receive signal to handle reload, shutdown

小試了一下怎樣用Python開一隻thread, 然後讓它收signal 做reload跟 shutdown
https://github.com/jofenting/memo/blob/master/testSig.py
跑起來
python testSig.py

用另一個console送signal給他
reload
kill -1 <pid>

shutdown
kill -15 <pid>

收工

留言