[IPython-user] start ipython from my own script
Sat May 30 21:19:31 CDT 2009
Do you know how to instantiate --pylab in the similar fashion (from a shell
call and dropping into pylab enabled Ipython session) ?
On Sat, May 30, 2009 at 9:03 PM, Ondrej Certik <email@example.com> wrote:
> On Sat, May 30, 2009 at 7:55 PM, Ondrej Certik <firstname.lastname@example.org> wrote:
> > Hi,
> > I have a program or script and at one point I would like to start an
> > ipython shell and pass all my local/global variables into it, so that
> > I can experiment. Importing the whole script in ipython session
> > doesn't help, because I want to run ipython at some particular point.
> > E.g something like an enhanced version of:
> > import pdb
> > pdb.set_trace()
> > So far I tried:
> > import IPython
> > ipython = IPython.Shell.start()
> > ipython.mainloop()
> > that works, but I don't see the variables from the program. What is
> > the best way to do that?
> Here is how:
> import IPython
> shell = IPython.Shell.IPShell(user_ns=locals())
> Pretty cool!
> IPython-user mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-user