F
F
Funnix2021-06-04 20:34:38
WPF
Funnix, 2021-06-04 20:34:38

How to run python code in WPF C#?

Hello, please advise. I couldn’t start PythonNet, so I would like to know if there are other options. I have a simple WPF application written in C#. I just need to load the trained model and use the .predict() method, and pull the result of the prediction into external code. Is there any way to implement this at all?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2021-06-05
@vabka

There are three options:
1. Run the python through Process.Start
2. Make a web application in python and request a prediction via HTTP
3. Export the model to onnx and use it directly in sharp using ml net

A
Alexey Bereznikov, 2021-06-05
@gdt

Try IronPython , here Run a particular Python function in C# with IronPython seems to be the answer to your question, with sample code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question