<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I am trying to put together a basic proof of concept for running some python on the CPython interpreter from a C# host application.&nbsp; I have successfully invoked the RunSimpleString method on the PythonEngine class as follows:<br><br>&nbsp;PythonEngine.Initialize();<br>IntPtr lockPtr = PythonEngine.AcquireLock();<br>var result = PythonEngine.RunSimpleString(@&quot;print &quot;&quot;hello&quot;&quot;&quot;);<br>PythonEngine.ReleaseLock(lockPtr);<br>PythonEngine.Shutdown();<br><br><o:p></o:p></p><p class=MsoNormal>This worked as expected and output hello to the command prompt.<o:p></o:p></p><p class=MsoNormal><br>I then wanted to make sure I could get a simple example working with RunString so tried the following<br><br>PythonEngine.Initialize();<br>&nbsp;IntPtr lockPtr = PythonEngine.AcquireLock();<br>&nbsp;var result = PythonEngine.RunString(@&quot;print &quot;&quot;hello&quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;&quot;test&quot;&quot;<br>&nbsp;&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>PythonEngine.ReleaseLock(lockPtr);<br>PythonEngine.Shutdown();<br><br>This just appears to do nothing and the returned result object is null.&nbsp; Am I getting the complete wrong end of the stick with how to use RunString?<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>My System is:<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Windows 7 x64<o:p></o:p></p><p class=MsoNormal>Python 2.6.6 (64 bit)<o:p></o:p></p><p class=MsoNormal>The Python .net I downloaded was pythonnet-2.0-alpha2-136-py26.zip<o:p></o:p></p><p class=MsoNormal>My Visual Studio project is set to .Net 3.5<o:p></o:p></p><p class=MsoNormal><br><br>Thanks for your time,<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Alan<o:p></o:p></p></div></body></html>