0

我在 python 程序中有以下函数,也使用 tkinter。然而,当执行时,messagebox() 在播放器仍在播放剪辑的播放列表时被激活。是否可以在函数 ViewFile() 中封装(如果这是正确的术语)下面的代码,以便在播放完成后继续?MPV 确实提供了在完成后调用函数的能力(将使用它),但很想知道这个问题的答案。

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!")
4

0 回答 0