[IPython-user] Need post_runcode_hook

Brian Granger ellisonbg.net@gmail....
Mon Sep 29 15:23:21 CDT 2008

> Note that by the time it reaches runcode, it has been mangled by
> prefilters. Running non-python code can be done in prefilters (by
> translating the code to something like
> fortranrun("code-to-execute")

You are right that in many cases, this could be handled by
prefilter-level things.

Except it doesn't work for some cases.  The only case where this it
does work is when code-to-run, can be grabbed from a single IPython
input statement.  In many cases, you want to build/type code-to-run
out of _many_ IPython input statements (maybe one IPython input for
each _line_ of the fortran code).  This is how %autopx works.  Once
you enable %autopx, you simply type normal Python code (with no extra
syntax), but that code is run in parallel because of how %autopx hacks
ipython.  This continues until you toggle %autopx.  Does this make
sense?  Fernando, do you know how sage does these types of things?  Is
it a prefilter level thing?

The prefilter only works at the level of a single input (which can be
a line or blocks, but not multiple blocks).

More information about the IPython-user mailing list