Using only the modules that come with a standard python 2.6 installation, would it be possible to play a simple beeping noise?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
On windows:
34.4. winsound — Sound-playing interface for Windows:
http://docs.python.org/2.6/search.html?q=sound&check_keywords=yes&area=default
See also: Clear screen and beep for various platforms. (Python recipe) http://code.activestate.com/recipes/577588-clear-screen-and-beep-for-various-platforms/
If you're on a Unix terminal, you can print "\a" to get a terminal bell:
Of course, that will print a newline too… So
sys.stdout.write("\a")
might be better. But you get the idea.