I'm trying to print a line in python 3 that will change as the program goes on. For example, if I try:
import time
for i in range(0,10):
print('Loading' + '.'*i)
time.sleep(0.5)
I get:
Loading.
Loading..
Loading...
and so on. Can I make it that the previous line changes and gets another '.' added to it instead of printing a new one? Of course, I could do:
import time, os
for i in range(0,10):
os.system('cls')
print('Loading' + '.'*i)
time.sleep(0.5)
but that causes problems of its own. I know this question has been asked before, but all the answers given to it for some reason don't work. Doing something like:
import time
for i in range(0,10):
print('Loading' + '.'*i, end="\r")
time.sleep(0.5)
doesn't change anything, and replacing "\r" with " " just makes python not print anything for a while and then print out the whole row. What am I doing terribly wrong?