from time import sleep
for _ in range(10):
    for i in '|/-\\':
        print(i, end='')
        sleep(2)
        print('\b', end='')
Shouldn't this print a character then wait for 2 seconds and then delete it and start again?
For me this code runs with a blank line and only gives an output when its finished or stopped in middle. I've tried it on cmd and powershell
 
     
    