It only works visually in PyCharm
I'm writing an Elevator program and I tried to do the waiting lights animation like a real elevator. But I would like to print some outputs after, so that you can see the entire elevator before the lights animation starts.
from termcolor import cprint
import time
# this would be user's input
level = 10
# ABOVE PART ELEVATOR
cprint(' ▲ ▼ ', 'yellow')
cprint(' ┏' + ('━' * 13) + '┓')
# LIGHTS
print(' ┃', end='')
for lights in range(1, 11):
cprint('⦿', 'yellow', end='', flush=True)
time.sleep(0.5)
print('┃')
# LOWER PART ELEVATOR
print(' ┣━━━━━━╥━━━━━━┫')
print(' ┃ ║ ┃\n' * 5 + ' ┃ ║ ┃')
print('━━━━┗━━━━━━╨━━━━━━┛━━━━')
print(f'\nYou have arrived at floor ', end='')
cprint(level, 'yellow')
So this is the program that prints from left to right and from up to down like a normal program. But I would like the output to be:
▲ ▼
┏━━━━━━━━━━━━━┓
┃ #lights ┃ <- animation appears after the entire elevator
┣━━━━━━╥━━━━━━┫
┃ ║ ┃
┃ ║ ┃
┃ ║ ┃
┃ ║ ┃
┃ ║ ┃
┃ ║ ┃
━━━━┗━━━━━━╨━━━━━━┛━━━━
"You have arrived at floor 10" <- this after lights