[IPython-dev] Getting rid of "print" in ipython

Ville M. Vainio vivainio at gmail.com
Fri Jul 4 11:57:11 EDT 2008


IPython source code is riddled with direct calls to print statement.
Obviously, we should get rid of them.

What's the exact plan for this? For the time being, we could get rid
of them by introducing a global function for this (that initially just
does normal "print", and add proper output handling later.

My most urgent interest in this lies in the current inability to
easily capture magic command output. All magic command output should
be accessible in output history as string list, which we could easily
add if printing (inside magics) happened in controlled fashion.

My current suggestion: add global callable "pr" in ipapi, that is
connected to _ip.pr for the currently active IPApi object. Then, all
extensions could do "from IPython.ipapi import pr" and print to that
object to their heart's content.

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'



More information about the IPython-dev mailing list