kernel.util

Module: kernel.util

General utilities for kernel related things.

Functions

IPython.kernel.util.catcher(r)
IPython.kernel.util.curry(f, *curryArgs, **curryKWargs)
Curry the function f with curryArgs and curryKWargs.
IPython.kernel.util.printer(r, msg='')
IPython.kernel.util.tarModule(mod)

Makes a tarball (as a string) of a locally imported module.

This method looks at the __file__ attribute of an imported module and makes a tarball of the top level of the module. It then reads the tarball into a binary string.

The method returns the tarball’s name and the binary string representing the tarball.

Notes:

  • It will handle both single module files, as well as packages.
  • The byte code files (*.pyc) are not deleted.
  • It has not been tested with modules containing extension code, but it should work in most cases.
  • There are cross platform issues.