update of beep

This commit is contained in:
Miroslav Stampar 2010-10-26 06:30:27 +00:00
parent 9ec9d223e1
commit b9ff91b6e9

View File

@ -1506,6 +1506,7 @@ def beep():
if sys.platform == 'linux2': if sys.platform == 'linux2':
try: try:
if os.path.exists('/dev/audio'):
audio = file('/dev/audio', 'wb') audio = file('/dev/audio', 'wb')
for i in xrange(250): for i in xrange(250):
@ -1513,6 +1514,12 @@ def beep():
audio.write(chr(0) * 4) audio.write(chr(0) * 4)
audio.close() audio.close()
else:
import curses
curses.initscr()
curses.beep()
curses.endwin()
except: except:
dataToStdout('\a', True) dataToStdout('\a', True)
else: else: