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
15
votes
5 answers

Python - IronPython dilemma

I'm starting to study Python, and for now I like it very much. But, if you could just answer a few questions for me, which have been troubling me, and I can't find any definite answers to them: What is the relationship between Python's C…
Thomas Geritzma
  • 6,337
  • 6
  • 25
  • 19
14
votes
2 answers

IronPython invocation from C# (with SciPy) fails with ImportException: "No module named mtrand"

I have a python library I am trying to use via IronPython (v2.7 RC1 [2.7.0.30]) invocation from C# application. The library uses NumPy and SciPy quite extensively, which does work with SciPy and NumPy for .NET when ran using ipy from command line…
PeterParameter
  • 524
  • 5
  • 16
14
votes
2 answers

How to integrate Python Code with C#.Net Core language?

Am trying to integrate python code in my .net core application for data analysis and some machine learning classification. How can I do this the best way? Note: I don't want to execute scripts with IronPython. I already tried that before.
ak2492
  • 305
  • 1
  • 4
  • 14
13
votes
6 answers

Creating an interactive shell for .NET apps and embed scripting languages like python/iron python into it

I was learning python using the tutorial that comes with the standard python installation. One of the benefits that the author states about python is "maybe you’ve written a program that could use an extension language, and you don’t want to design…
Developer
  • 17,809
  • 26
  • 66
  • 92
13
votes
1 answer

Is .NET Core or .NET 5.0 supported by Pythonnet

I've been using Pythonnet for quite some time but always against .NET Framework 4.* With the recent release of .NET 5.0 I wanted to migrate my projects but I could not make it work for non-Framework versions (e.g. .NET Core 2.0, .NET Core 3.0, .NET…
jo31
  • 167
  • 1
  • 9
13
votes
1 answer

How to do multiprocessing using Python for .NET on Windows?

Now I'm developing C# app running on Windows. Some of processes are written in Python, that called via pythonnet (Python for .NET). The processes are calculation-heavy, so I want to do them in parallel. They are CPU-bounded and can be handled…
sfb
  • 133
  • 5
12
votes
1 answer

Why does Python.NET use the base method instead of the method from a derived class?

Edit: This will be fixed in a new version of pythonnet (when this pull request is merged). I have a problem with Python.NET inheritance. I have a DLL which consists of the following code: using System; namespace InheritanceTest { public class…
12
votes
5 answers

Communication between Python and C#

I have a Python backend running machine learning algorithms. I want to use the same backend for both an Excel plugin (C#) and a website. I want both interfaces to send my training data (thousands of lines of numbers in arrays) to the same Python…
Vincent L
  • 699
  • 2
  • 11
  • 25
12
votes
1 answer

How to save plots from multiple python scripts using an interactive C# process command?

I've been trying to save plots(multiple) from different scripts using an interactive C# process command. Objective: My aim is to save plots by executing multiple scripts in a single interactive python shell and that too from C#. Here's the code…
Ramkumar
  • 444
  • 1
  • 7
  • 22
12
votes
6 answers

Can I treat IronPython as a Pythonic replacement to C#?

I do understand that this topic has been covered in some way at StackOverflow but I'm still not able to figure out the exact answer: can I treat IronPython as a Pythonic replacement to C#? I use CPython every day, I love the Zen :) but my current…
Ewan Doe
  • 205
  • 1
  • 8
11
votes
3 answers

Compile Brotli into a DLL .NET can reference

So I'd like to take advantage of Brotli but I am not familiar with Python and C++.. I know someone had compiled it into a Windows .exe. But how do I wrap it into a DLL or something that a .NET app can reference? I know there's IronPython, do I just…
gt6707a
  • 649
  • 1
  • 7
  • 12
10
votes
3 answers

How to fix error during pythonnet installation

When I try to use following command: pip install pythonnet I see error that you can see below: Collecting pythonnet Using cached pythonnet-2.5.2.tar.gz (1.9 MB) Requirement already satisfied: pycparser in…
Dawid_K
  • 141
  • 1
  • 1
  • 10
10
votes
3 answers

how to prevent Poetry to consider .gitignore

I am working on a python project which uses pythonnet with several C# dll's as dependencies. As I do not want to push the dll's to the git repository I adapted the .gitignore file. However, now Poetry does not include the dll's into the python…
jodá
  • 342
  • 7
  • 25
10
votes
1 answer

Implement a C# Interface in Python for .NET

I have been given a library written in C# that I'm trying to call using Python for .NET. The primary class I need an instance of has a constructor like: GDhuClient(IGDhuSettings) There are no (exposed) classes that implement the IGDhuSettings…
Ghillie Dhu
  • 213
  • 2
  • 10
10
votes
2 answers

Python property factory or descriptor class for wrapping an external library

I am writing a Python wrapper class for a C# API accessed through Pythonnet. As I want to extend the API with my own methods I decided to wrap it using the composition approach outlined here: The C# API makes heavy use of properties which I want to…
Olaf
  • 371
  • 2
  • 11
1
2
3
38 39