问题
I want to use some python files in a Visual Studio WPF application, using this code.
var ipy = Python.CreateRuntime();
dynamic test = ipy.UseFile("Test.py");
string whatever = test.pythonString()
MessageBox.Show(whatever);
where Test.py looks like this:
def pythonString:
return "Whatever"
everything works as expected but if I add any import like
from moviepy.editor import *
to the python code the messagebox doesn't appear. Why does this happen and what do I have to change in order to make python work in Visual studio with libraries?
EXTRA INFO: I use Visual Studio 2015 on Windows 7.
I set up IronPython like this: https://blogs.msdn.microsoft.com/charlie/2009/10/25/running-ironpython-scripts-from-a-c-4-0-program/
来源:https://stackoverflow.com/questions/39862954/using-python-files-with-libraries-in-visual-studio