.net

Microsoft Tick time to Python Datetime

Microsoft Tick time to Python Datetime Question: There’s a lot of answers to my question but mine is a little different in that I’m not entirely sure if its Microsoft’s tick time. The situation is I’m receiving the following from my firms API and they’ve told me its tick time but it doesn’t match with …

Total answers: 1

Python script called in a .NET API in docker, dependencies not found

Python script called in a .NET API in docker, dependencies not found Question: Hello I have a project with the following folder structure (abstracted): . └── root/ ├── ExRate_Service/ │ ├── MyOwnPythonScripts… │ └── Program.py ├── ExRate_API/ │ ├── ExRate_API/ │ │ ├── Classes… │ │ ├── ExRate_API.csproj │ │ └── Program.cs │ ├── ExRate_API.Tests/ …

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

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

How to invert the regular expression group capture logic?

How to invert the regular expression group capture logic? Question: To create a capturing group in a regex you use (match) and you prefix it with ?: to make it non-capturing, like (?:match). The thing is, in any kind of complicated regular expression I find myself wanting to create far more non-capturing groups than capturing …

Total answers: 2

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

Why does Python.NET use the base method instead of the method from a derived class? Question: 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 { …

Total answers: 1

Pandas Dataframe or similar in C#.NET

Pandas Dataframe or similar in C#.NET Question: I am currently working on implement the C# version of a Gurobi linear program model that was earlier built in Python. I have a number of CSV files from which I was importing the data and creating pandas dataframes, and I was fetching columns from those dataframes to …

Total answers: 4

How to handle exception in using(Py.GIL()) block pythonnet

How to handle exception in using(Py.GIL()) block pythonnet Question: Is there a way to handle exceptions in using the (Py.GIL()) block? For example: using System; using Python.Runtime; public class Test{ public static void Main(){ using(Py.GIL()){ try{ dynamic module = Py.Import("module"); dynamic result = module.function("argument"); Console.WriteLine(result); } catch(Excepiton ex){ // Handled Exception } } } } …

Total answers: 1

Call a python function with named parameter using python.net from a C# code

Call a python function with named parameter using python.net from a C# code Question: I want to call a python function from C# code. To do that, I used Python for .NET to call function as shown in the following lines of code using System; using Python.Runtime; public class Test{ public static void Main(){ using(Py.GIL()){ …

Total answers: 2

Use OpenCV with Powershell

Use OpenCV with Powershell Question: I currently have a Python script that is using OpenCV and PIL to auto crop head shots. My work has asked me to convert to powershell for various reasons of working in a windows world. Looking around I am not seeing anything specific to powershell but I have seen some …

Total answers: 1