How to write Python program that simply emits a beep sound when run. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to write Python program that simply emits a beep sound when run.

21st Jan 2019, 4:20 PM
Nishu Malik
Nishu Malik - avatar
2 Answers
+ 2
To help others answer, please identify the target OS.
21st Jan 2019, 6:41 PM
Kirk Schafer
Kirk Schafer - avatar
0
Assuming your motherboard has a built in buzzer and it is active, print('\a') Should make it beep It is called the bell charachter In java is: System.out.print("\0007"); Some more info on escape chars here: https://linuxconfig.org/list-of-JUMP_LINK__&&__python__&&__JUMP_LINK-escape-sequence-characters-with-examples
29th Aug 2019, 6:44 PM
seamiki
seamiki - avatar