Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate audio bell in terminal using Python

Tags:

python

xterm

How can I generate audio bell in xterm type terminal?

like image 776
Pablo Avatar asked Sep 22 '11 12:09

Pablo


1 Answers

Simple, print the bell character. In Python:

print('\a')

From bash shell:

echo $'\a'

Note that on some terminals, the bell can be disabled. In others, the bell can be replaced with a visual bell in the shape of a flashing screen background.

like image 138
Yuval Adam Avatar answered Sep 19 '22 10:09

Yuval Adam