Open tmr232 opened 8 years ago
Should be possible, just change
https://github.com/james91b/ida_ipython/blob/master/python/ipythonEmbed.py#L64-L65
to
app.kernel.user_module = __main__
app.kernel.user_ns = __main__.__dict__
When i first did this, older versions in iPython i used to have strange issues with the auto completion and the completer frame. However, after my simple tests, it seems to work fine in Jupyter. So this is a change we could make.
Yes, it works :smile:
Now I wonder if that indeed a good idea - as the global namespace is extremely messy.
Yeah, I'm not actually sure what would be more useful. Global namespace can make some thing easier, however it can be messy and if you ever want to affect the global namespace from a notebook you should be able to just import main and do it that way.
We could also make it an option to launch the notebook in a new namespace or the global namespace.
The main (and only) use I see for keeping the global namespace is interaction with plugins. I think it is a worthwhile cause. If we have a way to get the all the data from that scope without dirtying the new one, that would be great.
Currently, the IPython console and the regular Python console inside IDA have different namespaces.
Is it possible to merge those namespaces?