我知道CSharp是Xamarin中的语言,但有时python的某些功能很棒,所以我想在Xamarin下调用python脚本。 我知道ironpython,所以我尝试它。 我添加了一些必需的程序集,如:IronPython.dll,IronPython.Module,Microsoft.Scripting.dll ...幸运的是,我成功构建它,并在我的Android设备上运行。 但是当运行的代码:有没有什么办法可以在Xamarin.Android下使用python脚本?
ScriptEngine engine = Python.CreateEngine();
ScriptScope scope = engine.CreateScope();
ScriptSource source = engine.CreateScriptSourceFromString("");
source.Execute(scope);
时出现错误:
Microsoft.Scripting.InvalidImplementationException:
Type 'IronPython.Runtime.PythonContext' doesn't provide a suitable public constructor or its implementation is faulty:
Could not load type 'IronPython.Runtime.PythonContext' from assembly 'IronPython, Version=2.7.5.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1'.
那么,是否有可能使用上Xamarin.Android Python脚本?
因此,您要将一个python运行时添加到一个xamarin运行时,该运行时与arm虚拟机的Java虚拟机在arm处理器?我无法想象一个如此“棒极了”的python特性,我想发布一个30MB的“Hello World”应用程序。学习C#。 – 323go