[IPython-User] module reloading in 0.11
Wed Aug 3 23:35:27 CDT 2011
On Wed, Aug 3, 2011 at 21:19, Aaron Meurer <email@example.com> wrote:
> Will reloading the kernel use the same profile?
Yes, it should be exactly as it was on first launch.
> I want to develop on SymPy, and do ipython qtconsole profile=sympy,
> and restart the kernel (but not the console) whenever I edit a sympy
> Also, how exactly do you restart the kernel?
> Aaron Meurer
> On Wed, Aug 3, 2011 at 3:55 AM, Robert Cimrman <firstname.lastname@example.org> wrote:
>> Hi Thomas,
>> On 08/03/11 11:31, Thomas Kluyver wrote:
>>> Hi Robert,
>>> On 3 August 2011 09:03, Robert Cimrman<email@example.com> wrote:
>>>> In 0.10.2, when one edits a Python script, it is very convenient to try it
>>>> ipython shell using the %run command. But, if a module imported in the
>>>> changes, it is not reloaded, just as the docs say "(except for sharing
>>>> objects such as previously imported modules)".
>>>> Could this "problem" be solved somehow by the new two-process architecture
>>>> 0.11? I have just tried the Git version, and it behaves just like 0.10.2 in
>>>> this respect.
>>> I don't think the two-process architecture has any effect on it at all - all
>>> your code is loaded and run in the kernel. You can restart the kernel from
>>> the frontend, but then you lose everything in your namespace (like closing
>>> IPython and starting it again).
>> Yes, I was thinking of restarting the kernel would wipe-out everything. But for
>> behaviour like 'clear all' in matlab it should be ok, right?
>>> Have a look at the code in IPython.lib.deepreload - I think it should be
>>> possible to tweak the %run magic so that it replaces the
>>> __builtin__.__import__ function before running code, and puts it back
>> I will, thanks for the tip!
>> IPython-User mailing list
> IPython-User mailing list
More information about the IPython-User