[IPython-user] Macro problems with threading on

Erik Tollerud erik.tollerud@gmail....
Tue Oct 21 16:11:47 CDT 2008

I've been encountering a rather annoying problem for a while now while
using ipython interactively for scientific data analysis.  It seems
that when I create a macro, only the first line of the macro can
actually be executed:

In [1]: print 2
In [2]: print 3
In [3]: macro pr 1-2
Macro `pr` created. To execute, type its name (without quotes).
Macro contents:
print 2
print 3
In [4]: pr
------> pr()

Now I know the macro is being recorded correctly, because if I do "ed
pr", the file has both print statements.  But ipython simply won't
execute anything but the first line. The other odd thing is that it
seems to be specific to threading... if I invoke ipython without any
of the threading parameters (-wthread, -gthread, -pylab, etc.), macros
work fine.  But as soon as I use any of the GUI threading extensions,
it goes back to only running the first line.

This seems to be a common use-case scenario, so I'm surprised that
I've seen no mention of it... but I've tested this on two different
computers (Ubuntu Hardy  32 bit and a fresh Intrepid 64 bit) and the
same thing happens... is there a known workaround to this that I just

More information about the IPython-user mailing list