-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmyClock.py
More file actions
36 lines (29 loc) · 842 Bytes
/
myClock.py
File metadata and controls
36 lines (29 loc) · 842 Bytes
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
#!/usr/bin/python
import os
import time
import datetime
# 1. the year as a four-digit number, e.g. 2007
# 2. the month (1, 2, , 12)
# 3. the day of the month (1, 2, , 31)
# 4. hour (0, 1, , 23)
# 5. minutes (0, 1, , 59)
# 6. seconds (0, 1, , 61 where 60 and 61 are used for leap seconds)
# 7. week day (0=Monday, 1=Tuesday, , 6=Sunday)
# 8. day of the year (1, 2, , 366)
# 9. daylight saving time information (0, 1, or -1)
while True:
locTime = time.localtime()
os.system('clear')
lineHolder = str(locTime[3]) + '| '
for i in range(locTime[3]):
lineHolder += '#'
print lineHolder
lineHolder = str(locTime[4]) + '| '
for i in range(locTime[4]):
lineHolder += '#'
print lineHolder
lineHolder = str(locTime[5]) + '| '
for i in range(locTime[5]):
lineHolder += '#'
print lineHolder
time.sleep(1)