1

I have tried print('\a') just to preduce a sound, but it didn't work. Why and How can I make it work? I'm on a linux system.

zer0uno
  • 7,521
  • 13
  • 57
  • 86
  • @Cyber I have already read it and nothing, the solution proposed doesn't work...in addition it doesn't explain why it doesn't work – zer0uno Aug 19 '14 at 11:47
  • 4
    There is an almost infinte number of reasons why this might not play a sound. Beeos might be disabled in your terminal, or the volume turned down in your mixer, or the PC speaker kernel module is not loaded, or one of many many other possible causes. It's not really possible to answer this question with the information given. – Sven Marnach Aug 19 '14 at 11:50

1 Answers1

2

The code works, the problem is probably your terminal settings. Go there and find the settings for "bell" and make sure it's set to "audible" or whatever your system calls it (as opposed to "visual" or "disabled" etc.).

To prove that it isn't Python's fault, try pressing backspace at the terminal prompt when nothing has been typed on the line. This should make the bell ding on most systems where it is enabled.

John Zwinck
  • 239,568
  • 38
  • 324
  • 436
  • I'm using gnome terminal and the sound is enabled but even pressing the backspace no sound is generated. – zer0uno Aug 19 '14 at 12:16