clr

How to load an excel file in IronPython?

How to load an excel file in IronPython? Question: I am trying to load an excel file within an IronPython script, which is embedded within a software. I tried to do this with the following code: import clr clr.AddReference("Microsoft.Office.Interop.Excel") import Microsoft.Office.Interop.Excel as Excel excel = Excel.ApplicationClass() excel.Visible = True workbook = excel.Workbooks.Open("C:UsersantoiDesktoprimo_reportae-project-reportingcodes_02_heat_recoverydataunit_data_simp_08.xlsx") However, I get …

Total answers: 1

Python CLR Winforms – Passing data between .NET Winforms

Python CLR Winforms – Passing data between .NET Winforms Question: I have a fairly simple task that has eluded me when using Python to generate and automate .NET WinForms. How do I pass data between forms? I’ve tried everything: using global variables, using immutable strings, etc. and nothing seems to stick. Can someone show me …

Total answers: 1

Accessing C# DLL through Python 3.8 using Python.Net (TypeError)

Accessing C# DLL through Python 3.8 using Python.Net (TypeError) Question: I have the following python 3.8.2 code that attempts to access methods from my C# DLL In the example it is using a method to calculate the area of a pipe. import clr clr.AddReference(r"calcsDLL") from myDLL import calcs calcs.Pipe_Area(0.2) Here is my implementation of the …

Total answers: 1

Python CLR WinForms – Opening another from from an existing form

Python CLR WinForms – Opening another from from an existing form Question: I am having some extreme difficulty with something so simple. All I am trying to do is launch another Windows Form from an existing Windows Form in Python. I’ve tried everything I can think of and I cannot figure out. Below is a …

Total answers: 1

Cythonized Python.Net code cannot find system assemblies

Cythonized Python.Net code cannot find system assemblies Question: When I compile with Cython the Python code which uses Python.NET to access .NET assemblies, it can’t find those assemblies: ModuleNotFoundError: No module named ‘System’ Without compilation it works ok. For demo code, I used https://github.com/pythonnet/pythonnet/blob/master/demo/helloform.py My setup.py file: from distutils.core import setup from distutils.extension import Extension …

Total answers: 1