I have the following function in a python program, also using tkinter. However, when executed, the messagebox() is activated while the player is still playing the playlist of clips. Is it possible to encapsulate (if that is the correct term) the below code within the function ViewFile() so it continues after done playing? MPV does give an ability to call a function after it is completed (will play with that), but would love to know the answer to this.
def ViewFile():
player.stop()
global directory
selected_text_list = [lb.get(i) for i in lb.curselection()]
lbFrame.lower() ## lbFrame.lift() to raise back up
for f in selected_text_list:
path_and_file = directory + f
player.playlist_append(path_and_file)
player.playlist_pos = 0
player.wait_for_playback
messagebox.showinfo("Last one played!")