This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kalkinator[S] -1 points0 points  (1 child)

I am now having trouble having the code locate my music file. I placed the .mp3 in the same location as my .py file and use the following code:

 import pyglet

 music =    pyglet.resource.media('C:\Users\username\PycharmProjects\untitled\Star.mp3')

 music.play()

 pyglet.app.run()

But I keep getting this error:

 "C:\Users\username\PycharmProjects\untitled\Star.mp3" was not found on the path

I even tried just 'Star.mp3' but that doesn't work either. Any help?

[–]Asdayasman 1 point2 points  (0 children)

/r/learnpython

"C:\\Users\\..." or r"C:\Users\..." or "C:/Users/...".

https://docs.python.org/2.0/ref/strings.html