I know that a similar question has been asked here. The methods work well when the size of the string is not exceeded from a single line. Please consider the following code, which does not have a long string:
import time
for x in range(100):
print(x, "times", end="\r")
time.sleep(0.2)
Now consider the following code. You can see that it just clears the exceeded line not all characters of the printed string. I want the same behavior of the above code.
import time
for x in range(100):
print(x, "timesjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj", end="\r")
time.sleep(0.2)
Please note that I use VS code. How can I clear all characters when the size of the string is long?