For example, the youtube-dl command.
In Powershell, there is a progress bar that is continuously updated while downloading.
like the third line in this image
But in python,the third line of output will only appear after it reaches 100%.
This is my code.
import subprocess
f = subprocess.Popen('youtube-dl -f 160 https://youtu.be/W8l5zlR_3_E', shell=True, stdout=subprocess.PIPE)
for i in f.stdout:
print(i.decode(encoding="utf-8"), end="")