I like the following:
print 'Downloading File FooFile.txt [%d%%]\r'%i,
Demo:
import time
for i in range(100):
time.sleep(0.1)
print 'Downloading File FooFile.txt [%d%%]\r'%i,
print('Downloading File FooFile.txt [%d%%]\r'%i, end="")
Demo:
import time
for i in range(100):
time.sleep(0.1)
print('Downloading File FooFile.txt [%d%%]\r'%i, end="")
# On PyCharm Debugger console, \r needs to come before the text.
# Otherwise, the text may not appear at all, or appear inconsistently.
# tested on PyCharm 2019.3, Python 3.6
import time
print('Start.')
for i in range(100):
time.sleep(0.02)
print('\rDownloading File FooFile.txt [%d%%]'%i, end="")
print('\nDone.')