[IPython-User] Kernprof in ipython 0.11?

Robert Kern robert.kern@gmail....
Thu Sep 1 21:08:04 CDT 2011

On 9/1/11 7:07 AM, reckoner wrote:
> Will the exceptional kernprof module make it into IPython 0.11 as a magic?

Not distributed *with* IPython, no. It's easy to configure IPython 0.11 to add 
its %lprun magic, though. Just make a file line_profiler_ext.py in your 
~/.ipython/extensions/ directory:

   import line_profiler
   def load_ipython_extension(ip):
       ip.define_magic('lprun', line_profiler.magic_lprun)

Then add it to your list of extensions in your ipython_config.py:

# A list of dotted module names of IPython extensions to load.
c.TerminalIPythonApp.extensions = [

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the IPython-User mailing list