Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- status_bar = Label(root, text="", bd=1, relief=GROOVE, anchor=E)
- status_bar.pack(fill=X, side=BOTTOM, ipady=2)
- def play_time():
- current_time = pygame.mixer.music.get_pos() / 1000
- converted_current_time = time.strftime("%M:%S", time.gmtime(current_time))
- current_song = song_box.curselection()
- song = song_box.get(current_song)
- song = f"C:/gui/audio/{song}.mp3"
- song_mut = MP3(song)
- song_length = song_mut.info.length
- converted_song_length = time.strftime("%M:%S", time.gmtime(song_length))
- status_bar.config(text=f"Time Elapsed: {converted_current_time} of {converted_song_length} ")
- status_bar.after(1000, play_time)
- # В края на функцията stop добави
- # status_bar.config(text="")
- # и промени song = song_box.get(current_song) на song = song_box.get(ACTIVE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement