Better way of printing ascii art at given framerate


I am trying to optimize printing ascii art at given framerate. Now i am using time.sleep() but this is inconsistent because it doesnt add time when the frames are opening. I am asking is there a library which can handle this for me ?

This is my curent code:

def play_ascii():
    maxcount = len(os.listdir('temp/ascii'))
    count = 1
    interval = input("Sleep between frames (recommended value: 0.03)")
    winsound.PlaySound("temp/audio.wav",winsound.SND_ASYNC or winsound.SND_ALIAS)
    while count != maxcount:
Asked By: Vojtěch Šokala



fpstimer might help
It can maintain certain a FPS in runtime
here is its PYPI link:

Answered By: faked grid
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.