[IPython-user] Qt gui now usable (sort of) :-)

Ville M. Vainio vivainio@gmail....
Thu Dec 4 23:49:49 CST 2008


On Fri, Dec 5, 2008 at 5:58 AM, Brian Granger <ellisonbg.net@gmail.com> wrote:

> 1) How did you get the GUI talking to an IPython instance?  Did you
> use any of the frontend stuff that Gael and Barry have worked on?

I just embed an ipython instance "normally" (as you would do when you
use ipython as a library - in fact qt ui only uses ipython as a
library so far), and call _ip.runlines() for blocks. It sucks in that
ipython's raw input history is screwed up (everything is executed the
way macros are), but I have my own (trivial & incomplete) input
history implementation in the gui (frontend is the right place for it
anyway).

> 2) How do you handle stdout/stderr?

I capture it, covert to html and append to QTextEdit. I copy-pasted
the code from laurent's gui code, but it's pretty trivial in the first
place (reassign sys.stdout & stderr).

We probably should allow configuring the OutputTrap in a core as well,
we just don't have that yet.

>
> 3) Are you still using the line based IPython prefilter, or do you
> have an actual block based prefilter now?

_ip.runlines() does all the prefiltering, so I didn't need to care
about that (so yes, it's the line based prefilter, but I don't think
there is a need for block-based prefilter). Prefiltering just happens
in the backend.

-- 
Ville M. Vainio
http://tinyurl.com/vainio


More information about the IPython-user mailing list