I am developing an application, which autoplay an audio file when a button is pressed (using markdowns). There are multiple button and each one would play different sound upon clicked.
Currently, I am using time.sleep function to complete the execution of audio file before the code is executed again for other inputs. However, the user can press another button before finishing the audio, which is not optimal. Is there a way to disable the button as soon as it is pressed, and enable it after the audio is completed.
Thanks a lot for your solution. It did help me solve this problem using placeholder. However, I hope that generating the button thrice would not slow down the server (especially when there are ~20 buttons)