lang-model/naive-nlu/depth_meter.py

13 lines
347 B
Python
Raw Normal View History

import sys
def show_depth(depth: int):
2017-05-21 12:08:29 +00:00
multiplier = 3
max_depth = 5
offset = int((max_depth - depth) / (2 / multiplier))
depth = depth * multiplier
offset -= int(depth % 2)
sys.stdout.write("\r|\x1b[K" + (u'' * int(depth / 2)) + (u'' * int(depth % 2)) + ' ' * offset + "|\x1b[7m \x1b[0m\b")
sys.stdout.flush()