<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def signal_handler(self, signum, frame):
 """ Handle print_exit via signals. """

        self.print_exit()
        print("\n(Terminated with signal %d)\n" % (signum))
        sys.exit(0)