-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplay_text.py
More file actions
44 lines (31 loc) · 945 Bytes
/
Copy pathDisplay_text.py
File metadata and controls
44 lines (31 loc) · 945 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
37
38
39
40
41
42
43
44
# Mostly for debugging, when my testbed doesn't have a display.
import gc
class Display_text():
'''Being a simple stdout-based display'''
def __init__(self):
self._line_1 = ""
self._line_2 = ""
self._line_3 = ""
def set_line_1(self, text):
self._line_1 = text
self._render()
def set_line_2(self, text):
self._line_2 = text
self._render()
def set_line_3(self, text):
self._line_3 = text
self._render()
def blank(self):
pass
def animate_idle(self):
pass
def _render(self):
gc.collect()
mem = gc.mem_free()
print(f"+--------------------------------------+")
print(f"| {self._line_1:20} ")
print(f"| {self._line_2:20} ")
print(f"| {self._line_3:20} ")
print(f"|")
print(f"| {mem:9} ")
print(f"+--------------------------------------+")