hi guys and thanks a lot for your quickly replies. I followed your advices and I tried to study how the "tqdm" library works but I really don't understand how to use it with my script.
from what I understood with tqdm I can create a progress bar to check a "for" loop in real time. I wrote an example below:
ok, it's simple, but what about if I have many "for" loops in my script? most of my code is composed by many "for" loops. maybe I could apply tqdm for all of them, but how can I do it and at the same time have an unique loading bar?
then I have another dubt. even if I applied qtdm for each "for" loop, what about the rest of the code? I have some "while" loops too, and other "if/elif/else" instructions. they help me to read some text files, and create new variables.
maybe I could simply print an empty progress bar at the first time and then full it every some pice of code read, i don't know.
yeah, let me explain me better ahah.. in Python I know many topics but i'm not an expert. I read the free book "Think Python" and I followed many tutorials online. now I can do many things but currently I can't still program with the classes. I'm still studying.
from what I understood with tqdm I can create a progress bar to check a "for" loop in real time. I wrote an example below:
text = "hola\nciao\nhi\nsalut\nпривет" import time from tqdm import tqdm for line in tqdm(text.split()): time.sleep(2)for each line in "text", the script waits 2 seconds. when I run it the progress bar created by tqdm go ahead every 2 seconds and in 10 seconds it covers all the bar.
ok, it's simple, but what about if I have many "for" loops in my script? most of my code is composed by many "for" loops. maybe I could apply tqdm for all of them, but how can I do it and at the same time have an unique loading bar?
then I have another dubt. even if I applied qtdm for each "for" loop, what about the rest of the code? I have some "while" loops too, and other "if/elif/else" instructions. they help me to read some text files, and create new variables.
maybe I could simply print an empty progress bar at the first time and then full it every some pice of code read, i don't know.
(Nov-12-2019, 04:17 PM)perfringo Wrote: I remember the days when “beginner” was something which didn’t comprise ability to write 1000 lines of code with CLI interface....
yeah, let me explain me better ahah.. in Python I know many topics but i'm not an expert. I read the free book "Think Python" and I followed many tutorials online. now I can do many things but currently I can't still program with the classes. I'm still studying.