Okay, I'm not sure what's going on, but tkSnack (link) is deciding to not work for me all of a sudden. I have written a full-blown freaking media player with it, and I am now failing to simply play a song from the command line. I can get it to work in an interactive Python shell, but nothing more. Here is the code I am using:

from Tkinter import *
import tkSnack

root = Tk()
root.withdraw()
tkSnack.initializeSnack(root)
sound = tkSnack.Sound(load="/home/foo/song.mp3")
sound.play()

I just...have no idea why something this simple is not working. Could somebody help me out? Am I just tired or should this not be happening?

Thanks in advance.

You should add root.mainloop() at the end of your program. I am also playing with this library and I just discovered the necessity to add this line. Good Luck ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.