pythonnet
-
python + .net core integration, use pythonnet프로그래밍 2024. 7. 26. 15:04
파이썬가 .net core에 대한 통합 방법은 여러가지가 있다. ironpython을 사용하는 방법.process stdio를 사용하는 방법. 오늘은 .net에서 python 인터프린터 구현인 pythonnet을 소개한다. 먼저 pythonnet은 python의 .net 인터프린터 구현인 만큼 process stdio를 사용하는 방법보다 효율적이고 성능면에서 보다 나은 방법인다. 아래의 기본적인 사용코드를 보자. PythonEngine.Initialize(); using (Py.GIL()) { dynamic np = Py.Import("numpy"); Console.WriteLine(np.cos(np.pi * 2)); dynamic sin = np...