I tried Pyglet in a Python3 and a Python2 script, but both fail. The error code is below and the script is attached. The 'boot.ogg' file is Ubuntu's default bootup sound. I got my code from this link (http://guzalexander.com/2012/08/17/playing-a-sound-with-python.html).

collier@Nacho-Laptop:~$ ./pyglet.py
Traceback (most recent call last):
  File "./pyglet.py", line 2, in <module>
    import pyglet
  File "/home/collier/pyglet.py", line 3, in <module>
    song = pyglet.media.load('./boot.ogg')
AttributeError: 'module' object has no attribute 'media'


Mahalo,

DCJ
#!/usr/bin/env python
import pyglet
song = pyglet.media.load('./boot.ogg')
song.play()
pyglet.app.run()
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to