Add progress bar visuals to tests.
This commit is contained in:
parent
8e304b2a09
commit
e0a5f02c34
3 changed files with 31 additions and 4 deletions
15
naive-nlu/tree_nlu/utils/visuals.py
Normal file
15
naive-nlu/tree_nlu/utils/visuals.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
def show_progbar(done, total, msg=''):
|
||||
total_blocks = 10
|
||||
blocks_done = (done * total_blocks) // total
|
||||
blocks_to_go = total_blocks - blocks_done
|
||||
|
||||
print('\r\x1b[K' # Go to the start of the line
|
||||
'\x1b[0m' # Restart the "style"
|
||||
'|' # Put the first "|"
|
||||
+ blocks_done * '█' # Completed blocks
|
||||
+ blocks_to_go * ' ' # Uncompleted blocks
|
||||
+ '\x1b[7m|\x1b[0m' # End the bar
|
||||
+ ' '
|
||||
+ msg # Add message
|
||||
+ '\r' # Go back to the start
|
||||
, end='')
|
Loading…
Add table
Add a link
Reference in a new issue