System Beep?
ssmitch at gmail.com
ssmitch at gmail.com
Tue Mar 12 09:13:40 EDT 2019
On Saturday, March 9, 2019 at 12:53:35 AM UTC-5, Terry Reedy wrote:
> On 3/8/2019 1:13 PM, Steve wrote:
> > How can I cause a system beep using code?
>
> >>> import winsound as ws
> >>> ws.Beep(500, 1000)
>
> and
>
> >>> from tkinter import Tk
> >>> root = Tk()
> >>> root.bell()
>
> work for me. The bell is not exactly a bell, but different from a
> monotone beep.
>
> --
> Terry Jan Reedy
Another way that works (at least in Python 2.7) is
>>> import winsound
>>> winsound.MessageBeep(-1)
Not exactly a beep, but definitely a pleasant alert.
Stephen Mitchell
More information about the Python-list
mailing list