Answer the question
In order to leave comments, you need to log in
How to output and change string in CMD Python?
It is necessary for some script to make a progress bar.
You can, of course, print a new line each time using print(), but how, for example, can you print and change an already existing line so as not to create a new one? Ps I'm new to python and maybe I still don't understand something, so please don't judge too harshly.
Answer the question
In order to leave comments, you need to log in
import time
for i in range(1, 101):
print('{} {}%'.format('#' * (i // 10), i), end='\r')
time.sleep(0.1)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question