<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thank you.<br>
<br>
<br>
On 08/15/2011 02:11 PM, Thomas Kluyver wrote:
<blockquote
cite="mid:CAOvn4qhUhVeBvrNtFfBGUEvMGrZ3dKueV_yq-o9nN5zZBA2qdw@mail.gmail.com"
type="cite">
<div class="gmail_quote">On 15 August 2011 18:59, Darren Govoni <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:darren@ontrenet.com">darren@ontrenet.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div id=":ze">ip = InteractiveShellEmbed()<br>
<br>
I viewed the online docs for it, but it didn't show how to
do this<br>
programmatically.</div>
</blockquote>
</div>
<br>
To run pure Python code in the interactive namespaces,
"ip.ex(code)" should work. To run code as if it was entered at the
prompt (translating magic functions, saving as a history entry,
increasing prompt count), use "ip.run_cell(code)". In the latter
case, code needs to be a string, not a compiled code object.<br>
<br>
There may also be a way using config to run code as the shell
starts up, but I'm not sure if that works for embedding.<br>
<br>
Thomas<br>
</blockquote>
<br>
</body>
</html>