I wanted to know a command in which I could update the screen and the new information would appear in the same place, just like a "loading" bar that when increasing does not create a copy at the bottom but updates in the same position.
I wanted to know a command in which I could update the screen and the new information would appear in the same place, just like a "loading" bar that when increasing does not create a copy at the bottom but updates in the same position.
To make a load bar, install and use tqdm
.
In the command window (cmd) or terminal emulator:
pip install tqdm
Code:
from tqdm import tqdm
import time
for i in tqdm(range(100)):
# Seu código de iteração aqui.
# O tqdm pode ser usado em qualquer iterador.
# Aqui só damos um time.sleep pra simular carga.
time.sleep(0.1)