python print update code example
Example 1: print progress without next line python
print i/len(some_list)*100," percent complete \r",
Example 2: print progress without next line python
def f():
print('xy', end='')
print('\rzz')
f()
>> zz // \r make cursor reset to the start of the line and over-write any text after that
Example 3: update print python
from time import sleep
N=12
for i in range(N):
sleep(0.5)
print(f"{i/N*100:.1f} %", end="\r")