Python Sound (“Bell”)

后端 未结 6 1061
无人共我
无人共我 2020-11-29 04:03

I\'d like to have a python program alert me when it has completed its task by making a beep noise. Currently, I use import os and then use a command line spee

6条回答
  •  没有蜡笔的小新
    2020-11-29 04:27

    If you have PyObjC (the Python - Objective-C bridge) installed or are running on OS X 10.5's system python (which ships with PyObjC), you can do

    from AppKit import NSBeep
    NSBeep()
    

    to play the system alert.

提交回复
热议问题