[IPython-user] start ipython from my own script

Gökhan SEVER gokhansever@gmail....
Sat May 30 21:19:31 CDT 2009


Ondrej,

Do you know how to instantiate --pylab in the similar fashion (from a shell
call and dropping into pylab enabled Ipython session) ?

Gökhan


On Sat, May 30, 2009 at 9:03 PM, Ondrej Certik <ondrej@certik.cz> wrote:

> On Sat, May 30, 2009 at 7:55 PM, Ondrej Certik <ondrej@certik.cz> 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())
> shell.mainloop()
>
> Pretty cool!
>
> Ondrej
> _______________________________________________
> IPython-user mailing list
> IPython-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20090530/15ab9870/attachment.html 


More information about the IPython-user mailing list