I was trying to play a song with pygame, but instead of giving the path directly i wanted to give a variable that stores the path to the pygame.mixer.music.load() method. I used to run this, and it worked.
b = "C:\\Users\\Enny\\Music\\I can tell.mp3"
def pMusic():
import pygame
pygame.mixer.init()
pygame.mixer.music.load(b)
pygame.mixer.music.play()
a = input("")
if a == "play":
pMusic()
But now every time i try, i get this error
Traceback (most recent call last):
File "test.py", line 17, in <module>
pMusic()
File "test.py", line 11, in pMusic
pygame.mixer.music.load(b)
pygame.error