[IPython-user] start ipython from my own script
Sun May 31 19:32:16 CDT 2009
On Sun, May 31, 2009 at 6:06 PM, Ondrej Certik <firstname.lastname@example.org> wrote:
> On Sat, May 30, 2009 at 8:19 PM, Gökhan SEVER <email@example.com> wrote:
>> Do you know how to instantiate --pylab in the similar fashion (from a shell
>> call and dropping into pylab enabled Ipython session) ?
> Unfortunately I don't know, but try to investigate what the --pylab
> option really does and then there are maybe some kwarguments how to do
> it. Or just patch ipython to do it and send a patch.
> To all --- I am using the following combination quite often now:
> import IPython
Actually, to emulate pdb.set_trace(), I want to be able to access both
locals and globals, e.g. here is my line:
I tried to implement this:
$ bzr diff
=== modified file 'IPython/__init__.py'
--- IPython/__init__.py 2009-03-17 03:05:22 +0000
+++ IPython/__init__.py 2009-06-01 00:29:16 +0000
@@ -59,6 +59,13 @@
+ Starts the IPython shell with the user namespace set to union of globals()
+ and locals().
+ Shell.IPShell(user_ns=dict(globals(), **locals())).mainloop()
# Release data
from IPython import Release # do it explicitly so pydoc can see it - pydoc bug
__author__ = '%s <%s>\n%s <%s>\n%s <%s>' % \
But it's not easy, the above doesn't work.. It's because globals() and
locals() are different inside that set_trace() function. So I think it
will require more hacking with frames. Before I try to do it --- would
you accept such a patch to ipython?
More information about the IPython-user