-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclock.py
More file actions
executable file
·112 lines (100 loc) · 1.38 KB
/
clock.py
File metadata and controls
executable file
·112 lines (100 loc) · 1.38 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
"""
clock.py
"""
from datetime import datetime
from time import sleep
from os import system, name
ascii = ['''
000000
00 00
00 00
00 00
000000
''',
'''
11
11
11
11
11
''',
'''
222222
222
222222
222
222222
''',
'''
333333
333
333333
333
333333
''',
'''
44 44
44 44
444444
44
44
''',
'''
555555
555
555555
555
555555
''',
'''
666666
66
666666
66 66
666666
''',
'''
777777
77 77
77
77
77
''',
'''
888888
88 88
888888
88 88
888888
''',
'''
999999
99 99
999999
99
999999
''',
'''
::
::
'''
]
def clear():
if name == 'nt':
system('cls')
else:
system('clear')
clear()
while True:
clock = str(datetime.now())[11:19] # splice to remove date
clockList = [] # save current time in array format, to call ascii[i]
for i in range(len(clock)):
if i == 0 or i == 1 or i == 3 or i == 4 or i == 6 or i == 7 or i == 8: # do not print ':'
clockList.append(int(clock[i]))
else:
clockList.append(10)
splittedAscii = [ascii[j].splitlines() for j in clockList]
for k in zip(*splittedAscii):
print(*k, sep='')
sleep(1)
clear()