"ast" <nom...@invalid.com> Wrote in message: > > "ast" <nom...@invalid.com> a écrit dans le message de > news:54648e75$0$12771$426a7...@news.free.fr... >> >> "ast" <nom...@invalid.com> a écrit dans le message de >> news:54648d03$0$1981$426a7...@news.free.fr... >> >>> >>> I have the idea to run an other thread to emit the sound, but I didn't try >>> yet. >>> Is it the solution ? >>> >> >> nope, still doesn't work ! >> > >> root.after(1, mybeep) > > > with: > > f = Frame(root, width=300, height=300) > f.pack() > f.config(bg='Yellow') > root.after(80, mybeep) > > it works and with: > > f = Frame(root, width=300, height=300) > f.pack() > f.config(bg='Yellow') > root.after(60, mybeep) > > it doesn't work > > I understand that Python takes times to create the root > window and to color the frame. It the sound arrives > before the end of the drawing, Python goes to the sound > emitting,and when finished it goes back to drawing. > > This is annoying > I would like sometuhing stable if possible >
I don't use Windows, but from what I read, winsound.Beep is a blocking call, and therefore must not be used in the main thread of a gui environment. Once the function is called, no events are processed. It seems like you need winsound.SND_ASYNC -- DaveA -- https://mail.python.org/mailman/listinfo/python-list