Created
May 10, 2018 00:36
-
-
Save acwoss/49e699bef9499880e20ba9185f656339 to your computer and use it in GitHub Desktop.
HeftyLovingStructure created by acwoss - https://repl.it/@acwoss/HeftyLovingStructure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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