Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to Call Python Code from Blazor WebApp

$
0
0

I am trying to run a python script from a Blazor WebApp using pythonnet. The python script is located in the project but the PyModule.Import call to the script throws an error saying the module can't be found.

Runtime.PythonDLL = @"C:\Users\homepc\AppData\Local\Programs\Python\Python312\python312.dll";PythonEngine.Initialize();using (Py.GIL()){    PyObject pyScript = PyModule.Import(@"PythonCalls");    string result = pyScript.InvokeMethod("test");}

How do I call a python script from a Blazor WebApp using pythonnet?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>