[IPython-dev] cProfile and iPython
Fri Jul 2 10:41:14 CDT 2010
I have found an odd bug when I used cProfile in an iPython shell. It seems
to not load the same environment as the shell. The following is a very
x = 25
cProfile.run("y = math.sqrt(x)")
This throws an exception "NameError: name 'math' is not defined"
Similar problems occur if I define a function "foo" and call that in run. I
should also note that using "run -p" works just fine for a cProfile-less
version of the above script. I am using a stock install of python 2.6.5 and
ipython 0.10 on Ubuntu 10.04.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev