Octopus_Carnival/ono_sendai/animation/octopus.py

24 lines
468 B
Python
Raw Normal View History

2019-08-18 17:19:11 +02:00
from colorama import Style, Fore
from time import sleep
from os import system
frames = []
for i in range(5):
2019-08-19 00:12:42 +02:00
with open('animation/'+str(i)+'.txt', 'r') as f:
2019-08-18 17:19:11 +02:00
content = f.read()
frames.append(f'{Fore.MAGENTA}'+content+f'{Style.RESET_ALL}')
def animate(n):
2019-08-19 00:12:42 +02:00
system('clear')
2019-08-18 17:19:11 +02:00
for i in range(n):
print(frames[i%5])
sleep(0.2)
system('clear')
if __name__ == '__main__':
from sys import argv
animate(int(argv[1]))