1
我目前試圖在我的遊戲中嵌入這個項目xna console,但我遇到了IronPython解釋器的問題。在C#遊戲中嵌入IronPython腳本的問題
的問題我有是用下面的代碼
this.PythonOutput = new MemoryStream();
ScriptingEngine.pyEngine.SetStandardOutput(PythonOutput); // this line is giving me an error 'Microsoft.Scripting.Hosting.ScriptEngine' does not contain a definition for 'SetStandardOutput' and no extension method 'SetStandardOutput' accepting a first argument of type 'Microsoft.Scripting.Hosting.ScriptEngine' could be found
this.ASCIIEncoder = new ASCIIEncoding();
和第二個問題是有與此代碼
ClrModule clr = ScriptingEngine.pyEngine.Import("clr") as ClrModule;
clr.AddReference("Microsoft.Xna.Framework");
clr.AddReference("Microsoft.Xna.Framework.Game");
正在逐漸與ClrModule問題不能聲明靜態類型的變量'IronPython.Runtime.ClrModule也導入給我錯誤Microsoft.Scripting.Hosting.ScriptEngine不包含'導入'的定義
我正在使用IronPython版本2.7.1和.net4