[IPython-user] Using IPShellEmbed

Frédéric Mantegazza mantegazza at ill.fr
Thu Oct 12 02:16:01 CDT 2006

Le jeudi 12 octobre 2006 08:57, Fernando Perez a écrit :

> Yes, it allows you to set the user's local namespace.  The fact that
> %who doesn't list its contents is an unfortunate implementation
> artifact: when the shell starts, it first scans the contents of
> user_ns and hides those keys from display with %who, so that anything
> that got loaded before startup isn't shown, and you only see things
> you actually created interactively.  That decision seemed like a good
> policy when I wrote %who years ago (and ipshellembed didn't exist),
> but it may not be such a good one in this context.  I'm not even 100%
> sure it was such a good idea in the first place :)

In fact, this is OK for me too! Don't change anything for me! It allows me 
to hide some objects from user. This way, only advanced users can access to 
these objects :o)

I have another question: I execute some code inside IPShellEmbed with 
IP.runlines() method. Is there a way to catch exceptions and avoid the code 
to stop? I implemented a custom exception handler, with the 
IP.set_custom_exc() method, but I don't know how to tell the shell to 
continue the execution (under some conditions).

Is it possible ?



More information about the IPython-user mailing list