<s>[INST] Text Progress Bar in the Console Is there a good way to do the following?
I wrote a simple console app to upload and download files from an FTP server using the ftplib.
Each time some data chunks are downloaded, I want to update a text progress bar, even if it's just a number.
But I don't want to erase all the text that's been printed to the console. (Doing a "clear" and then printing the updated percentage.)
 [/INST] Writing '\r' will move the cursor back to the beginning of the line.
This displays a percentage counter:
import time
import sys

for i in range(100):
    time.sleep(1)
    sys.stdout.write("\r%d%%" % i)
    sys.stdout.flush()

 </s>