lang-model/naive-nlu/depth_meter.py
2017-05-21 14:08:29 +02:00

13 lines
347 B
Python

import sys
def show_depth(depth: int):
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()