I am currently working on creating an interactive python terminal, using the IPython kernel.
I have been successful at setting up a working interpreter (over web using websockets), using the KernelManager class ('IPython.kernel.manager.KernelManager'). However, I also want to implement a feature where I can save a "snapshot" of the kernel's current state. In other words, I want to save a copy of the locals() and globals() dict of the kernel, which I then should be able to apply back to the kernel at a later time, to practically jump back (or forwards) in time.
To do this, I need to understand how I can directly access the namespace of the interpreter, without it actually going through the messaging channels of the kernel. That is, I need the actual references to the objects in the namespace.
Is this possible? I have been trying to scour the IPython documentation for the better part of a day without much success.
Thank you very much for your help.
Eirik