0

I have been trying to call a C# dll from python with no success. My C# class is:

namespace ClassLibrary1
{
    public class Class1
    {
        public double Add_It(double x1, double x2, double x3, double x4)
        {
            return x1 * x4 * (x1 + x2 + x3) + x3;
        }
     }
}

and Python code is:

import clr
clr.AddReference('C:/Users/MNCHR/Desktop/ClassLibrary1.dll')
from ClassLibrary1 import Class1

The error is

ImportError: cannot import name 'Class1'

please advise

001
  • 13,291
  • 5
  • 35
  • 66

0 Answers0