Back to index

python3.2  3.2.2
Namespaces | Functions
curses Namespace Reference

Namespaces

namespace  ascii
namespace  has_key
namespace  panel
namespace  textpad
namespace  wrapper

Functions

def initscr
def start_color

Detailed Description

curses

The main package for curses support for Python.  Normally used by importing
the package, and perhaps a particular module inside it.

   import curses
   from curses import textpad
   curses.initwin()
   ...

Function Documentation

def curses.initscr ( )

Definition at line 26 of file __init__.py.

00026 
00027 def initscr():
00028     import _curses, curses
00029     # we call setupterm() here because it raises an error
00030     # instead of calling exit() in error cases.
00031     setupterm(term=_os.environ.get("TERM", "unknown"),
00032               fd=_sys.__stdout__.fileno())
00033     stdscr = _curses.initscr()
00034     for key, value in _curses.__dict__.items():
00035         if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):
00036             setattr(curses, key, value)
00037 
00038     return stdscr
00039 
00040 # This is a similar wrapper for start_color(), which adds the COLORS and
00041 # COLOR_PAIRS variables which are only available after start_color() is
00042 # called.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 43 of file __init__.py.

00043 
00044 def start_color():
00045     import _curses, curses
00046     retval = _curses.start_color()
00047     if hasattr(_curses, 'COLORS'):
00048         curses.COLORS = _curses.COLORS
00049     if hasattr(_curses, 'COLOR_PAIRS'):
00050         curses.COLOR_PAIRS = _curses.COLOR_PAIRS
00051     return retval
00052 
00053 # Import Python has_key() implementation if _curses doesn't contain has_key()
00054 
00055 try:
    has_key

Here is the caller graph for this function: