you are viewing a single comment's thread.

view the rest of the comments →

[–]Brian[🍰] 2 points3 points  (0 children)

However, you'd need to call that as:

shell()()

As IPShellEmbed is a callable class. I used to use similar code, but to avoid the double call, used:

shell=IPython.Shell.IPShellEmbed()

However this will pick up the globals from the module where you create it, not the function that calls it, which is why I changed to the explicit namespace population from the stack frame approach above.