2

I do not want to run the Python code from C#. I want to access few functions from the Python Program and use it inside my C# Code.

I have checked solutions and have found that run Python Script.
I do not want that.

I have a python code function like this:

import numpy as np

def test(abc): # abc is numpy array
    total = np.sum(abc)
    return total

I want to call this test function in C# code. Please let me know how I can do this.

Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
  • You have to create a wrapper and then run it which will be same as running a regular python script which I guess you don't want to. So if python code is not editable or no separate wrapper is written it may not be possible. – Aaj Kaal Nov 22 '20 at 13:07

0 Answers0