Python脚本可以在Windows应用商店应用中执行吗?

时间:2022-08-26 23:18:47

Is there any way to execute python script in Windows Store App? I'm trying to use IronPython. Project compiles with no error but when I try to execute my python script I got System.IO.FileNotFoundException with below exception message.

有没有办法在Windows应用商店应用程序中执行python脚本?我正在尝试使用IronPython。项目编译时没有错误但是当我尝试执行我的python脚本时,我得到了System.IO.FileNotFoundException以及以下异常消息。

Could not load file or assembly 'System.Core, Version=5.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

无法加载文件或程序集'System.Core,Version = 5.0.5.0,Culture = neutral,PublicKeyToken = 7cec85d7bea7798e'或其依赖项之一。该系统找不到指定的文件。

My C# code to execute python script is:

我执行python脚本的C#代码是:

var setup = new ScriptRuntimeSetup();
setup.DebugMode = true;
setup.LanguageSetups.Add(Python.CreateLanguageSetup(null));

var runtime = new ScriptRuntime(setup);
engine = runtime.GetEngineByTypeName(typeof(PythonContext).AssemblyQualifiedName);
string script = // Python Script;
engine.execute(script);

1 个解决方案

#1


1  

No, IronPython doesn't support Windows Store apps right now. It's not compiled against the proper framework and still uses some APIs that are not supported in Store apps.

不,IronPython目前不支持Windows应用商店应用。它不是针对正确的框架编译的,仍然使用Store应用程序不支持的一些API。

#1


1  

No, IronPython doesn't support Windows Store apps right now. It's not compiled against the proper framework and still uses some APIs that are not supported in Store apps.

不,IronPython目前不支持Windows应用商店应用。它不是针对正确的框架编译的,仍然使用Store应用程序不支持的一些API。