Small tool to show dynamic indicator when program is running.
running_sign_rotation(interval= 0, msg_pre="", msg_post="", sign = ["\", "|", "/", "-", "|", "/", "-"])
generator to show rotating indicator. parameter: interval: number, seconds of interval time between every frame of indicator. msg_pre: string, content will show before indicator. msg_post: string, conent will show after indicator. sign: list, symbols which will be showed sequentially.
generator to show progress bar. parameter: interval: number, seconds of interval time between every frame of indicator. msg_pre: string, content will show before indicator. msg_post: string, conent will show after indicator. sign: string, symbols which will be showed in progress way. max_num: number, max numbers of sign in one bar progress.
funtion, as entrance of two above function. parameter: refer to parameters in above function. If sign != None, will call running_sign_progress, otherwise will call running_sign_progress. return: generator.
function, show progress bar. parameter: msg_pre: string, content will show before indicator. msg_post: string, conent will show after indicator. sign: string, symbols which will be showed in progress way. pct: number, length of progress bar. scale: number, scale of progress bar, default = 1 while the length of progress bar is 100 which means 100 signs.
rs = running_sign_rotation(1)
for i in range(10):
next(rs)