python实现蜂鸣器演奏两只老虎

跑个程序,计算量太大,每个文件的数据都要计算好久。我就一边让他跑,我一边干点别的,但是又怕错过,就做了个提示音。后来我一想,提示音都做了,那就完善一下做个两只老虎吧~没什么技术含量,代码附上:

import ctypes
player = ctypes.windll.kernel32
#player.Beep(1000,200)

import time
time.sleep(0.5)
player.Beep(1047,955)
#time.sleep(0.00000000125)
player.Beep(1175,851)
#time.sleep(0.000125)
player.Beep(1319,758)
#time.sleep(0.000125)
player.Beep(1047,955)
#time.sleep(0.005)
player.Beep(1047,955)
#time.sleep(0.000125)
player.Beep(1175,851)
#time.sleep(0.000125)
player.Beep(1319,758)
#time.sleep(0.000125)
player.Beep(1047,955)
time.sleep(0.005)
player.Beep(1319,758)
time.sleep(0.00125)
player.Beep(1397, 751)
time.sleep(0.00125)
player.Beep(1568,637)
time.sleep(0.5)
player.Beep(1319,758)
time.sleep(0.00125)
player.Beep(1397, 751)
time.sleep(0.00125)
player.Beep(1568,637)

猜你喜欢

转载自blog.csdn.net/weixin_44843629/article/details/108988195