So im really not sure if this is possible but im trying to create a progress bar for my code in python but for each iteation i gt a new print line but what i want is the console to utilise the first statement...
progress = []
noDots = 50
noItems =601
if noItems >= noDots:
batch = int(noItems/noDots)
else:
noDots = noItems
batch = 1
for i in range(noDots):
progress.insert(0, '.')
for i in range(0,noItems,batch):
val = int(i/batch)
perc = round(((i/noItems)*100))
print(val)
if val ==0:
val == 0
else:
val -= 1
if progress[val] == '.':
progress[val] = '>'
if val == 0:
continue
else:
progress[val - 1] = '='
print(f'[{"".join(progress)}] {perc}%')
The output is as follows...