Copy CodeThe code is as follows:
#!/usr/bin/env python
# Coding:utf-8
#
#
# Show Time in console
#
Import Sys
Import time
Raws = "'
.--.
| |
`--`
.
/|
|
---
---.
---`
`---
---.
---|
---`
. .
`--|
|
.---
`--.
---`
.---
|--.
`--`
.--.
` |
|
.--.
|--|
`--`
.--.
`--|
---`
". Strip ()
Numbers = {}
DEF init ():
For NUM in range (10):
NUMBERS[STR (num)] = []
Lineno = 0
For line in Raws.split (' \ n '):
Line = Line.ljust (4)
arr = []
For Char in line:
Arr.append (char) #! = ")
Numbers[str (LINENO/5)].append (arr)
Lineno + = 1
numbers[': ' = ' [' ', ' ' ', ' ', '], [', ' ', '-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ', ', ', ', ' ']]
numbers['] = [[', ' ', ' ', '], [', ', ', ', '], [', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ', ', ' ']]
def print_num (digtal):
Digtal = str (digtal)
screen = []
For I in range (5):
Screen.append ([])
For num in digtal:
For I, Linechar in enumerate (Numbers[num]):
For Char in Linechar:
Screen[i].append (char)
Screen[i].append (")
For line in screen:
print '. Join (line)
Init ()
Def CLS ():
Sys.stdout.write (' \033[2j\033[0;0h ')
Sys.stdout.flush ()
While True:
t = time.strftime ("%h:%m:%s")
CLS (); Print_num (t)
Time.sleep (1)
t = Time.strftime ("%H%M%s")
CLS (); Print_num (t)
Time.sleep (1)