开发者

How to play sound till the user hits a key?

First thought of implementing this using threads but python doesnt have a way for killing threads. I have read the other topic on killing threads. Is there any proper platform independ开发者_JS百科ent way of doing this?


I think you'd better use a Tk timer for ringing periodically, and then stop it when you get the key press.

See http://www.java2s.com/Code/Python/GUI-Tk/Clockevent.htm for an example how to use timer.

Thus you will avoid creating another thread.


Can you be more specific? This could be done in pygame, but you'd need to open a graphical window.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜