When using module pyglet, giving the name of mp3 explicitly like sound="10.mp3", it works. When using module playsound and giving filenames as variable, playsound(str(play_num) + '.mp3'), it does work.
playsound(str(play_num)+'.mp3')
But when applying variable name of file to pyglet just like below, sound = "str(play_num)+'.mp3'", it does not work.
sound = "str(play_num)+'.mp3'"
it shows FileNotFoundError. How can I solve this problem??? In addition how to get the files from other directory and some other folder? When getting a sound file in other directory/folder using variable ?
player = pyglet.media.Player()
sound = "str(play_num)+'.mp3'"
src = pyglet.media.load(sound)
player.queue(src)
Use F-String: