SendText
SendText copied to clipboard
SendText with iPython Qtconsole
Any idea on the best way to insert code into an iPython Qtconsole window. I have come up with a little hack, by using some AppleScript in the SendText.py function but it is really clunky. I am really unfamiliar with AppleScript.
subprocess.call(['osascript', '-e', 'set the clipboard to "' + selection + '"',
'-e', 'tell application "Python" to activate',
'-e', 'tell application "System Events"',
'-e', 'tell process "iPython"',
'-e', 'delay 0.1',
'-e', 'keystroke "v" using command down',
'-e', 'keystroke return',
'-e', 'keystroke return',
'-e', 'keystroke return',
'-e', 'end tell',
'-e', 'end tell',
'-e', 'tell application "System Events"',
'-e', 'tell process "Sublime Text"',
'-e', 'set frontmost to true',
'-e', 'end tell',
'-e', 'end tell'])
Possible to send this to the iPython qtconsole directly through zeroMQ?