### Navigation

- index
- modules |
- next |
- previous |
- IPython v0.10 documentation »
- The IPython API »

# kernel.contexts

## Module: `kernel.contexts`

Inheritance diagram for `IPython.kernel.contexts`:

Context managers for IPython.

Python 2.5 introduced the with statement, which is based on the context manager protocol. This module offers a few context managers for common cases, which can also be useful as templates for writing new, application-specific managers.

## Classes

### `RemoteContextBase`

class `IPython.kernel.contexts.``RemoteContextBase`

  Bases: `object`

  `__init__`()
  `findsource`(frame)

### `RemoteMultiEngine`

class `IPython.kernel.contexts.``RemoteMultiEngine`(mec)

  Bases: `IPython.kernel.contexts.RemoteContextBase`

  `__init__`(mec)

## Functions

`IPython.kernel.contexts.``remote`()
  Raises a special exception meant to be caught by context managers.

`IPython.kernel.contexts.``strip_whitespace`(source, require_remote=True)

  strip leading whitespace from input source.

  Parameters: |

### Navigation

- index
- modules |
- next |
- previous |
- IPython v0.10 documentation »
- The IPython API »