beep is not genrated by python (was Re: just a beep)

Vladimir Ivanov mahasamatman at nm.ru
Tue Sep 2 04:12:32 EDT 2003


On Tue, 02 Sep 2003 13:06:00 +1000, Leo <halloleo.PLEASE at NOSPAM.gmx.net> wrote:

> hi there
>
> neither print chr(7) nor print "\a" works, when you execute the script directly under windows. (and executing under emacs doesn't work either.)
>
> it seems that the beep is not generated by python itself but by the terminal emulation.
>
> so again: is there a more robust and terminal independent way to generate a beep?
>
> cheers, leo
>
> Nick Welch wrote:
>> On Tue, Sep 02, 2003 at 10:17:02AM +1000, DG wrote:
>>
>>> print chr(7)
>>>
>>> :)
>>
>>
>> print "\a" # too
>>
>> :)
>>
>
If You attempt to use your script only under windows you should try this:
 import Winsound
Winsound.Beep(frequency, duration)

 -- best regards
Vladimir Ivanov





More information about the Python-list mailing list