[IPython-user] Sending input to IPython from a separate thread.
Wed Sep 26 03:44:24 CDT 2007
I'm starting to write a Vim plugin for sending text for a buffer to
IPython for evaluation. The idea is to send the text via sockets to a
thread on a running instance of IPython which will then evaluate the text.
A simplified version of what I am trying to achieve follows:
import sys, threading
from IPython.Shell import *#IPShellEmbed
ipshell = IPShellEmbed()
t = threading.Thread(target=get_shell_runner(ipshell))
ipshell.IP.runsource("2 * 3")
Now this falls over due to the history object (IP.input_hist) isn't
getting updated. So I'm fairly sure I'm using the wrong method to send
the text to the shell.
What I want to see on the screen is the following:
In : 2 * 3
Out : 6
What I'm actually getting (after hacking the Prompts module to suppress
the error...) is this:
1]: In : 6
Any tips anyone?
More information about the IPython-user