Can I use python to run a C# script file(.cs)?

943 Views Asked by At

I'm working with python on a project using OPT GIGE cameras. What I need now is to show the camera vision and capture a frame with my Python script. I didn't find anyway to connect to the gige camera with opencv in python, so I decide to use halcon to capture the image. But halcon can only export to .cs file I wonder is there anyway to use python to execute a .cs script?

1

There are 1 best solutions below

1
Dmitry Zuev On

It seems that you confused C# source code file and C# Script file.

The former has a .cs extension and is just a source code file, wich should be included in the project and compiled, and requires .NET Framework or other .NET runtime, depending on the OS version, to run.

The latter has a .csx extension and looks more like what you are looking for - however, it still requires .net libraries. More about .csx files can be found here and here