Skip to content

Instantly share code, notes, and snippets.

@X-88
Created February 14, 2021 15:43
Show Gist options
  • Save X-88/4ad595eaa26991c2da87df42cd2c6368 to your computer and use it in GitHub Desktop.
Save X-88/4ad595eaa26991c2da87df42cd2c6368 to your computer and use it in GitHub Desktop.
Simple Typewriter animation in python 3.xx
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