views:

68

answers:

1

Hey everyone reading this,

I've recently got into doing GUI development with Python. Tkinter seems like the easiest and most logical choice starting out. I did a little with wxPython but it was more sophisticated than what I needed.

Anyway, I'm developing a media player. Right now it's a simple window with a button to load .wav files. The problem is I would like to implement a pause button now. But, when playing a audio file the GUI isn't accessible again (no buttons can be pushed) till the file is done playing. How can I make the GUI dynamic while an audio file is playing?

I was thinking this maybe be because I'm using PyAudio, and their implementation doesn't allow this. Anyway, thanks for any advice before hand.

+3  A: 

Probably you have to use threads for that. You have to play your audio file in a different thread than the gui mainloop so that the GUI keeps responding user input.

IMHO, wxpython is not so complicated and has some utility functions that would help to do what you want. Check the wxpython demo, you have several examples there.

joaquin
I implemented thread while waiting for a response, it worked. Thanks for the response either way.
Nicholas Quirk