beeping noise on windows

dsavitsk dsavitsk at e-coli.net
Tue Jan 29 02:29:25 EST 2002


thanks.

i have a program that runs every night at 12:30 (i guess that's morning) to
give a 5 minute countdown and then shut my computer down.  i am in law
school, and i have class in the morning, so i need something to warn me that
time for python-ing is over.

problem is, if i am in another room my computer shuts down and i lose
unsaved work.  beeps help.

-d


"Bengt Richter" <bokr at oz.net> wrote in message
news:a34eof$cj1$0 at 216.39.172.122...
> On Mon, 28 Jan 2002 09:12:35 -0600, "Jason Orendorff"
<jason at jorendorff.com> wrote:
>
> >> back on my Apple II+ i could write the line
> >> "print Ctrl-G"
> >> and the computer would beep.  Is there a command as simple to make
windows
> >> beep for me? -- from python?
> >
> >http://www.python.org/doc/1.5.2p2/lib/module-winsound.html
> >
> >import winsound
> >winsound.PlaySound(".Default", winsound.SND_ALIAS | winsound.SND_ASYNC)
> >
> >Other sounds are available:
> >  "SystemAsterisk"
> >  "SystemExclamation"
> >  "SystemQuestion"
> >  "MailBeep"
> >  ...
> >
> >There's a list in your registry somewhere; search for SystemAsterisk.
> >Use SND_FILENAME instead of SND_ALIAS if you want to specify which
> >WAV file to play.
> >
> It might be worth mentioning that you also have the option of playing
> the old-fashioned beep on the computer's speaker rather than through
> the sound system. E.g.,
>
>  >>> import winsound
>  >>> winsound.Beep(440,250)
>
> plays an "A" for 250 milliseconds on the computer's internal speaker.
>
> (Note the upper case 'B' on 'Beep')
>
> Regards,
> Bengt Richter
>
>





More information about the Python-list mailing list