Why is it that when i write this code..
for i in range(5):
print('*', end = ' ')
time.sleep(.5)
it works in the pycharm console. That is it sequentially prints a * then sleeps for a half a second and prints another star directly after the last star and repeats 5 times.
Thus giving the impression of the computer is loading or computing or whatever.
But when I save the file and run it in a terminal it doesnt work like that. instead it acts more like this:
time.sleep(2.5)
print('*****')
it sleeps for the duration of the loop then prints the five stars all at once. What gives?
for i in range(5):
print('*', end = ' ')
time.sleep(.5)
it works in the pycharm console. That is it sequentially prints a * then sleeps for a half a second and prints another star directly after the last star and repeats 5 times.
Thus giving the impression of the computer is loading or computing or whatever.
But when I save the file and run it in a terminal it doesnt work like that. instead it acts more like this:
time.sleep(2.5)
print('*****')
it sleeps for the duration of the loop then prints the five stars all at once. What gives?