Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
HeftyLovingStructure created by acwoss - https://repl.it/@acwoss/HeftyLovingStructure
import signal
def timeout(signum, frame):
raise Exception('Seu tempo acabou!')
signal.signal(signal.SIGALRM, timeout)
signal.alarm(5)
try:
signal.alarm(5)
name = input('Qual é o seu nome? ')
signal.alarm(0)
print('Seja bem-vindo,', name)
except Exception as e:
print(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.