-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspinner.py
executable file
·93 lines (68 loc) · 2.25 KB
/
spinner.py
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
#!/usr/bin/env python3
#
# spinner.py: Show a spinning clock or something.
# 2018-03-24: Written by Steven J. DeRose.
#
import argparse
__metadata__ = {
"title" : "spinner",
"rightsHolder" : "Steven J. DeRose",
"creator" : "http://viaf.org/viaf/50334488",
"type" : "http://purl.org/dc/dcmitype/Software",
"language" : "Python 3.7",
"created" : "2018-03-24",
"modified" : "2020-03-01",
"publisher" : "http://github.com/sderose",
"license" : "https://creativecommons.org/licenses/by-sa/3.0/"
}
__version__ = __metadata__['modified']
descr = """
=Description=
Display a spinning clock-face in a shell window using Unicode clock-faces.
=Related Commands=
=Known bugs and Limitations=
=History=
* 2018-03-24: Written by Steven J. DeRose.
* 2018-11-07: Py 3.
=Rights=
This work by Steven J. DeRose is licensed under a Creative Commons
Attribution-Share Alike 3.0 Unported License. For further information on
this license, see http://creativecommons.org/licenses/by-sa/3.0/.
For the most recent version, see [http://www.derose.net/steve/utilities] or
[http://github.com/sderose].
=Options=
"""
###############################################################################
#
def processOptions():
try:
from BlockFormatter import BlockFormatter
parser = argparse.ArgumentParser(
description=descr, formatter_class=BlockFormatter)
except ImportError:
parser = argparse.ArgumentParser(description=descr)
parser.add_argument(
"--quiet", "-q", action='store_true',
help='Suppress most messages.')
parser.add_argument(
"--verbose", "-v", action='count', default=0,
help='Add more messages (repeatable).')
parser.add_argument(
"--version", action='version', version=__version__,
help='Display version information, then exit.')
args0 = parser.parse_args()
return(args0)
###############################################################################
# Main
#
args = processOptions()
clockMin = 0x1F550
clockMax = 0x1F55B
cur = clockMax
while(1):
cur += 1
if (cur>clockMax): cur = clockMin
u = chr(cur)
#u = eval('u"\U%08x"' % (cur)) # chr(cur)
print(u + chr(8), end="")
#sleep(1)