How to call a function from Python code to C# Library?

  c++, python, python-3.x

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.

Source: Python Questions

LEAVE A COMMENT