[Python] Python enumerate() tqdm progress-bar when reading a file?

Discussão em 'Python' iniciado por Stack, Julho 9, 2025.

  1. Stack

    Stack Membro Participativo

    I can't see the tqdm progress bar when I use this code to iterate my opened file:

    with open(file_path, 'r') as f:
    for i, line in enumerate(tqdm(f)):
    print("line #: %s" % i)
    for j in tqdm(range(line_size)):
    ...


    What's the right way to use tqdm here?

    Continue reading...

Compartilhe esta Página