How to replace print statements in Python 2.7, for example:
for i in range(100):
print i,"% Completed"
>>> 1 % Completed
1 should be replaced by 2 and so on. But not on another line or add on the same line.
I tried to find it, found a solution, for example
from __future__ import print_function
print("i: "+str(i),end="\r")
But they lead to the attached print statements. Is there any correction in mine print_functionor is there another solution?
source
share