I am trying to use pythonnet to run a python script from a .Net application , i installed pip , python and the project on git hub , also i did all the installation steps mentioned on https://github.com/pythonnet/pythonnet/wiki/Installation and the troubleshooting steps on https://github.com/pythonnet/pythonnet/wiki/Troubleshooting-on-Windows,-Linux,-and-OSX
when i created a windows application to run a python script, the project was built successfully , however when i click the button to execute a python script the application will exit showing the following output :
The program '[30236] WindowsFormsApplication1.vshost.exe: Program Trace' has exited with code 0 (0x0). The program '[30236] WindowsFormsApplication1.vshost.exe' has exited with code 1 (0x1).
the code i am using to execute the python file :
try
{
using (Py.GIL())
{
var test1 = "";
dynamic np = Py.Import("sum");
Console.WriteLine(np.cos(np.pi * 2));
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
when i tried to check where exactly the project stops , it was in the Python.RunTime project => runtime.cs =? Initialize() .
P.S : i am using pythonnet because i am using python 3.X and IronPython does not support this version.
Is there additional troubleshooting steps i must do ? or any more reference i should add ?