ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH

Reference
ActivePython 2.5
Python Documentation
Library Reference
14. Generic Operating System Services
14.1 os -- Miscellaneous operating system interfaces
14.2 time -- Time access and conversions
14.3 optparse -- More powerful command line option parser
14.4 getopt -- Parser for command line options
14.5 logging -- Logging facility for Python
14.6 getpass -- Portable password input
14.7 curses -- Terminal handling for character-cell displays
14.8 curses.textpad -- Text input widget for curses programs
14.9 curses.wrapper -- Terminal handler for curses programs
14.10 curses.ascii -- Utilities for ASCII characters
14.11 curses.panel -- A panel stack extension for curses.
14.12 platform -- Access to underlying platform's identifying data.
14.13 errno -- Standard errno system symbols
14.14 ctypes -- A foreign function library for Python.

MyASPN >> Reference >> ActivePython 2.5 >> Python Documentation >> Library Reference >> 14. Generic Operating System Services
ActivePython 2.5 documentation

14.9 curses.wrapper -- Terminal handler for curses programs

New in version 1.6.

This module supplies one function, wrapper(), which runs another function which should be the rest of your curses-using application. If the application raises an exception, wrapper() will restore the terminal to a sane state before re-raising the exception and generating a traceback.

wrapper( func, ...)
Wrapper function that initializes curses and calls another function, func, restoring normal keyboard/screen behavior on error. The callable object func is then passed the main window 'stdscr' as its first argument, followed by any other arguments passed to wrapper().

Before calling the hook function, wrapper() turns on cbreak mode, turns off echo, enables the terminal keypad, and initializes colors if the terminal has color support. On exit (whether normally or by exception) it restores cooked mode, turns on echo, and disables the terminal keypad.

See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved