(Unix only) The tty module contains some utility functions for dealing with tty devices. Example 12-9 shows how to switch the terminal window over to "raw" mode, and back again.
Example 12-9. Using the tty Module
File: tty-example-1.py import tty import os, sys fileno = sys.stdin.fileno() tty.setraw(fileno) print raw_input("raw input: ") tty.setcbreak(fileno) print raw_input("cbreak input: ") os.system("stty sane") # ... raw input: this is raw input cbreak input: this is cbreak input
Core Modules
More Standard Modules
Threads and Processes
Data Representation
File Formats
Mail and News Message Processing
Network Protocols
Internationalization
Multimedia Modules
Data Storage
Tools and Utilities
Platform-Specific Modules
Implementation Support Modules
Other Modules