Skip to content

Instantly share code, notes, and snippets.

@acwoss
Created May 10, 2018 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acwoss/49e699bef9499880e20ba9185f656339 to your computer and use it in GitHub Desktop.
Save acwoss/49e699bef9499880e20ba9185f656339 to your computer and use it in GitHub Desktop.
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