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
0
votes
1 answer

Detect specific return type of C# function python.net

Let's say I have the following C# function public byte AddOne(byte r){ return r + 1 } In my python code, I am able to call the function by doing something like x = AddOne(3) When I check the type of x, it always returns an int. This is true…
0
votes
0 answers

Accessing numpy array element directly using Python for .NET from VB.NET

I'm making good progress in converting an existing Python script across to VB.NET (please don't ask why), but have run into an issue accessing a numpy array using the row / column index. I feel pretty stupid not being able to sort this, having…
0
votes
1 answer

Python.Net using .NET Core Runtime instead of Mono on Linux

Is it possible to load a net core dll on Python and Linux, by using Python.Net, but relying on the .NET Core Runtime instead of mono? Seems it is not possible: Collecting pythonnet==2.4.0 Downloading pythonnet-2.4.0.tar.gz (1.8 MB) Building wheels…
carraua
  • 1,398
  • 17
  • 36
0
votes
0 answers

option not recognized error while installing pythonnet

I'm trying to install pythonnet via pip install pythonnet but accord error shown here: Collecting pythonnet Using cached pythonnet-2.4.0.tar.gz (1.8 MB) Building wheels for collected packages: pythonnet Building wheel for pythonnet (setup.py)…
Saeed Ramezani
  • 462
  • 6
  • 20
0
votes
1 answer

How to use ModernWPF Programaticially

ModernWPF is a great project, as it restyles my WPF app in modern UI style. The docs tell what XAML changes to be done to activate the styling. Unfortunately I am working with an application that is not XAML based (Python.NET). I tried already to…
mrh1997
  • 922
  • 7
  • 18
0
votes
1 answer

Using scope.set to assign a static class instead of a variable

I am trying to pass a static c# class into python using pythonnet. I am able to use scope.Set("person", pyPerson) similar to sample below. However in my case this is a utility (static) class and I get error that util does not contain testfn in…
gr stack
  • 3
  • 1
0
votes
0 answers

Can't install pythonnet on ubuntu 16.04

I'm trying to install pythonnet on my ubuntu, but without success. I tried some ways as: pip install pythonnet 2.pip install git+https://github.com/pythonnet/pythonnet there is any other way? ERROR: Command errored out with exit status 1: …
0
votes
1 answer

Pythonnet passing arguments to c# dll

I'm using Pythonnet 2.4.0 to access a C# dll. I have a Windows 10 machine with Python 3.7.6. I'm trying to use a method that only takes a path string as argument, but I don't manage to make it work. import…
Fuliante
  • 1
  • 3
0
votes
1 answer

pythonnet clr how to add reference to a dll assembly?

I am trying to import a dll package into python through pythonnet clr. I am aware that the package CLR and pythonnet both end up having a namespace called clr so the command "import clr" can be equivocal. Long story short, I seem to need pythonnet…
Father Geppeto
  • 139
  • 1
  • 8
0
votes
1 answer

Pythonnet unable to call VB.NET function with collection argument

I'm having an issue trying to call TestFunc as I'm getting TypeError: No method matches given arguments for TestFunc. My python code looks like so: import sys import…
dangerisgo
  • 1,261
  • 3
  • 16
  • 28
0
votes
1 answer

what version bundle does pythonnet_py35_dotnet work in?

Windows 8.1 Visual Studio 2015 NuGet pythonnet_py35_dotnet 2.3.0 I've tried about 15 different versions. Conda with python 3.5.0, 3.5.2, 3.5.4, 3.7.5 and many more different versions... Python 3.5.0, 3.5.4, 3.7.5, 3.6.2 and many more different…
0
votes
1 answer

Integrating a python Tensorflow chatbot model into a Xamarin app

I'm using Xamarin Forms to create a chatbot-like messaging app and I've created a simple chatbot model using TensorFlow and python. The model executes as a console app and after some testing, I've been able to run the python chatbot script in C#…
Draxalot2
  • 77
  • 7
0
votes
1 answer

PythonNet on MacOS: Got a SIGABRT while executing native code

I am trying to use a .Net DLL from python using pythonnet I am getting the following stack trace error * Assertion at sgen-alloc.c:379, condition `*p == NULL' not met ================================================================= Native…
Afsan Abdulali Gujarati
  • 1,375
  • 3
  • 18
  • 30
0
votes
1 answer

Using pythonnet to pass stream to .net DLL

I'm working with a .NET DLL file processor, but can't seem to get the stream passing working. I have the following relevant methods. EmbedFile(string): bool EmbedFile(Stream): bool When using the string version, it works as expected when given a…
s3c
  • 153
  • 6
0
votes
0 answers

Calling CPython from multiple threads

I'm trying to use pythonnet (C# library) from multiple threads, but it deadlocks. The following seems to be the procedure for calling CPython from that library: Py_InitializeEx(0); // Initialize CPython if (PyEval_ThreadsInitialized() == 0) …
HelloWorld
  • 3,381
  • 5
  • 32
  • 58