Closed juliantaylor closed 12 years ago
Just a heads up, there's a minor API change coming in IPython 0.12. The global_ns parameter (in shell(local_ns=locs, global_ns={})
) has been replaced by a module
parameter. This parameter was already optional in 0.11, so as you're just passing it an empty dictionary, I recommend you don't use a global_ns parameter at all.
Sorry to break the API again. If you've got any questions, please get in touch via mailing lists or IRC.
Update: My mistake, calling it without global_ns in 0.11 will take the global namespace of the module it's called from, which probably isn't what you want. This might require an extra try/except to decide whether to pass an empty global_ns dict or a new types.ModuleType()
object. Alternatively, in 0.12, you will be able to pass the namespace on instantiating the embedded shell, rather than on creating it, in which case only one option needs to be specified.
Another update: e're thinking of restoring the global_ns option for backwards compatibility, so don't worry about this for the moment. I'll post again when it's decided.
We've decided to leave the global_ns parameter in for 0.12. It may be removed in a future release, but there's no timetable for doing so.
try to use 0.11 and 0.10 api to open embedded ipython shell