Florian
Florian

Reputation: 1

Using tqdm in Python scripts executed through Taskfile does not show a live progress bar

When using the tqdm package for showing a progress bar in Python scripts, it does not display properly when the script is run through Taskfile. Using tqdm in a for loop should display a progress bar, but if the script is run through Taskfile, the completed progress bar is only displayed after the loop finished running.

It's a problem I had for a long time. I could not find anything online, so now that I solved it, I'm posting it here.

Upvotes: 0

Views: 104

Answers (1)

Florian
Florian

Reputation: 1

There is a setting in Taskfile that improves the display of interactive scripts: Interactive CLI application. Setting interactive to true also solves the issue encountered with tqdm.

version: '3'

tasks:
  default:
    cmds:
      - python scriptWithTqdm.py
    interactive: true

Upvotes: 0

Related Questions