-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex015.py
More file actions
47 lines (46 loc) · 1.43 KB
/
Copy pathex015.py
File metadata and controls
47 lines (46 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from time import sleep as wait
from os import system as cmd
while True:
print("Digite 1 para iniciar. \nOu qualquer tecla para sair do programa.")
a = None
try:
a = input()#capitura a saida do usuario
except KeyboardInterrupt:
pass
#saber qual o valor o usaurio digitou
if a == '1' :
cmd('cls')
tempo = 0
segundos = 0
minutos = 0
while True:
try:
tempo += 1
minutos = tempo // 60
segundos = tempo % 60
print(f"Digite CTRL + C para pausar.\nMinutos : {minutos} Segundos : {segundos}")
wait(1)
cmd('cls')
except KeyboardInterrupt :
cmd('cls')
print('Cronometro pausado.\nPrecione qualquer tecla para voltar . . .\n1 - Reiniciar\n2 - Sair')
try :
a = input()
except KeyboardInterrupt:
pass
if a == '1' :
cmd('cls')
minutos = 0
tempo= 0
minutos = 0
continue
elif a == '2' :
cmd('cls')
break
else :
cmd('cls')
pass
else:
cmd('cls')
print('Até mais. . .')
break