How play standard system sounds from a Python script?
I'm writing a GUI program in wxPython that needs to beep on events to attract user's attention, maybe there are functions in wxPython I can utilize?
How play standard system sounds from a Python script?
I'm writing a GUI program in wxPython that needs to beep on events to attract user's attention, maybe there are functions in wxPython I can utilize?
on windows you could use winsound
and I suppose curses.beep
on Unix.
From the documentation:
wxTopLevelWindow::RequestUserAttention
void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO)
Use a system-dependent way to attract users attention to the window when it is in background.
flags may have the value of either wxUSER_ATTENTION_INFO (default) or wxUSER_ATTENTION_ERROR which results in a more drastic action. When in doubt, use the default value.
Note that this function should normally be only used when the application is not already in foreground.
This function is currently implemented for Win32 where it flashes the window icon in the taskbar, and for wxGTK with task bars supporting it.