I have problem with integration with tqdm library (GitHub - tqdm/tqdm: A Fast, Extensible Progress Bar for Python and CLI ) to create nice progress bar, after executing code console won`t update
To install lib
pip install tqdm
Python code that works
import time
from tqdmLibrary import tqdm
pbar = tqdm(desc="Test", total=10)
for i in range(10):
time.sleep(0.3)
pbar.update()
pbar.close()
code of library
from tqdm import tqdm
from robot.api.deco import library, keyword
ROBOT_LIBRARY_DOC_FORMAT = "reST"
@library(scope="GLOBAL")
class tqdmLibrary:
def __init__(self):
pass
@keyword
def start_tqdm(self, total=None, desc=None, **kwargs):
self.pbar = tqdm(total=int(total), desc=desc, **kwargs)
@keyword
def update_tqdm(self, n=1):
self.pbar.update(int(n))
Robot Code
*** Settings ***
Library tqdmLibrary.py
*** Test Cases ***
Progres Bar
Start Tqdm total=10 desc=Test
FOR ${counter} IN RANGE 10
Update Tqdm
Sleep 0.3
END