Module: kernel.util

General utilities for kernel related things.


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

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.


  • 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.