Advertisement
horozov86

forward_btn

Jun 20th, 2024
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. def next_song():
  2.     next_song = song_box.curselection()
  3.     next_song = next_song[0] + 1
  4.    
  5.     song = song_box.get(next_song)
  6.    
  7.     song = f'C:/gui/audio/{song}.mp3'
  8.     pygame.mixer.audio.load(song)
  9.     pygame.mixer.audio.play(song, loop=0)
  10.    
  11.     song_box.selection_clear(0, END)
  12.     song_box.activate(next_song)
  13.    
  14.     song_box.selection_set(next_song, last=None)
  15.    
  16.    
  17. forward_btn = Button(controls_frame, image=forward_btn_img, borderwidth=0, command=next_song)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement