How to Solve NameError: name 'signal' is not defined

Solution: Import the 'signal' module

# Add the following line to the top of your code
import signal

 

For more information:
Python signal