When calling IPython.embed()
is it possible to give it a command or magic function to run after embedding happens.
I would like to run something like this
import IPython
IPython.embed(command='%pylab qt4')
My current workaround is to copy the command string to the clipboard, spawn a background thread which sends keystrokes %paste followed by enter to the current window. This works ok on linux, but it is very hacky and I can't get it working as well on Windows. It seems like it should be possible to specify this, but I've never grasped how the IPython configs are working or what arguments to embed are used for.