Created
February 14, 2021 15:43
-
-
Save X-88/4ad595eaa26991c2da87df42cd2c6368 to your computer and use it in GitHub Desktop.
Simple Typewriter animation in python 3.xx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidhelper | |
from os import system | |
from sys import stdout | |
from console_progressbar import ProgressBar | |
path = '/storage/emulated/0/sfx/sfx6.mp3' | |
msg = 'Membuat Animasi Sederhana\nMenggunakan Python 3.xx\nCoded by: Zephio 2020' | |
ah = androidhelper.Android() | |
pb = ProgressBar(total = 100, prefix='', suffix='', length = 20, decimals = 0, fill = '■', zfill = '□') | |
system('clear') | |
def pbar(): | |
for i in range(101): | |
system('sleep 0.1') | |
if (i % 5 == 0): | |
pb.print_progress_bar(i) | |
def ani(): | |
system('clear') | |
for i in msg: | |
stdout.write(i) | |
ah.mediaPlay(path) | |
stdout.flush() | |
system('sleep 0.3') | |
ah.mediaPlayClose() | |
pbar() | |
ani() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment