Questions tagged [python.net]

Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and Mono. Pythonnet provides a powerful application scripting tool for .NET developers. Using this package you can script .NET applications or build entire applications in Python, using .NET services and components written in any language that targets the CLR (C#, VB.NET, F#, C++/CLI) and CPython.

Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and Mono. Pythonnet provides a powerful application scripting tool for .NET developers. Using this package you can script .NET applications or build entire applications in Python, using .NET services and components written in any language that targets the CLR (C#, VB.NET, F#, C++/CLI) and CPython.

https://pythonnet.github.io/

578 questions
10
votes
3 answers

Can we load pandas DataFrame in .NET ironpython?

Can we load a pandas DataFrame in .NET space using iron python? If not I am thinking of converting pandas df into a csv file and then reading in .net space.
Alok
  • 3,160
  • 3
  • 28
  • 47
9
votes
2 answers

Using C# Assemblies from Python via pythonnet

I am using Windows 7, 64-bit. I have managed to download and install pythonnet, so import clr clr.AddReference("System.Windows.Forms") from System.Windows.Forms import Form works fine. I have also downloaded and compiled/run a C# application which…
Petter
  • 37,121
  • 7
  • 47
  • 62
9
votes
1 answer

Use .NET dll in Python

I've developed a dll in visual studio that I'd now like to use in Python using the standard IDLE. I cannot seem to find a straightforward solution to this anywhere. I've tried using pip install *dll location*, but to no luck (hopes were never…
Stinkidog
  • 425
  • 2
  • 7
  • 19
9
votes
4 answers

ImportError: No module named clr when using CPython of python.org

I'm writing C++ code which should invoke python scripts underneath. For this purpose I use cpython of python.org. Some of the python scripts execute .net code with help of python for .net and when it comes to .net all this fails. I tried to build…
y_d
  • 91
  • 1
  • 1
  • 3
9
votes
3 answers

Python and .NET integration

I'm currently looking at python because I really like the text parsing capabilities and the nltk library, but traditionally I am a .Net/C# programmer. I don't think IronPython is an integration point for me because I am using NLTK and presumably…
Trent
  • 2,122
  • 1
  • 24
  • 38
8
votes
1 answer

how to access a class from a dll in python?

I have a handfull of .dll files with classes designed to control an external device connected to my desktop via ethernet. I'd like to import these classes to python and use their member functions / variables etc to control the device. I have looked…
user1278616
  • 103
  • 2
  • 6
8
votes
0 answers

Pythonnet .NET 6

After hours of searching and trial and error, I finally decided to ask you guys for help. As I'm trying to call some functions from a .NET 6 open source project from python, I installed python3.8.4 on my raspberry pi and managed to install the…
EnflamedSoul
  • 145
  • 1
  • 8
8
votes
5 answers

Running Python Code in .NET Environment without Installing Python

Is it possible to productionize Python code in a .NET/C# environment without installing Python and without converting the Python code to C#, i.e. just deploy the code as is? I know installing the Python language would be the reasonable thing to do…
FatihAkici
  • 4,679
  • 2
  • 31
  • 48
8
votes
3 answers

Python for .NET: ImportError: No module named warnings

I am trying to embed python 2.6 in .NET 4.0. Following the very minimal documentation in "Python for .NET", I wrote a fairly straightforward code as follows: const string pythonModulePath = @"C:\Projects\PythonImport\PythonImport\test.py"; …
sdeveloper
  • 139
  • 2
  • 6
8
votes
2 answers

PythonNet FileNotFoundException: Unable to find assembly

I am trying to execute a Python script that uses Python For .Net (https://github.com/pythonnet/pythonnet) to load a C# library called "Kratos_3.dll" which is in the same folder as the script but the file cannot be found. I have installed clr using…
baconwichsand
  • 1,161
  • 2
  • 13
  • 31
8
votes
2 answers

How to pass python callback to c# function call

I am trying to use C# classes from python, using python.net on mono / ubuntu. So far I managed to do a simple function call with one argument work. What I am now trying to do is pass a python callback to the C# function call. I tried the following…
joelhoro
  • 890
  • 1
  • 9
  • 20
8
votes
1 answer

Would you share your idea how to call python command from embedded Python.Net?

I've been played with Python.Net for a week, but I can't find any sample code to use Python.Net in embedded way although Python.Net source has several embeddeding tests. I've searched many threads from the previous emailing list (Python.Net), the…
spark
  • 531
  • 6
  • 17
7
votes
3 answers

Pythonnet dotnet core 'No module named'

I am trying to use a .NET Core library inside a Jupyter Notebook python script by using PythonNet. Support for .NET Core was added recently (see https://github.com/pythonnet/pythonnet/issues/984#issuecomment-778786164) but I am still getting a No…
JChristen
  • 588
  • 4
  • 21
7
votes
3 answers

Calling python code(.py files) from C#

I have some python code that does a certain task. I need to call this code from C# without converting the python file as an .exe, since the whole application is built on C#. How can I do this?
Raj
  • 440
  • 2
  • 6
  • 22
7
votes
2 answers

Accessing webcam via DirectShow using COM with Python

I want to get low level access to webcam properties using DirectShow's IAMVideoProcAmp. There are several Python modules )pywin32, pywintypes, comtypes, win32com, pythoncom) that are used in this context and they seem to be related somehow. But I…
Joe
  • 6,758
  • 2
  • 26
  • 47
1 2
3
38 39