C
C#2y ago
Dropps

Python to CS entrypoint

how can i compile a python package into a dll or so and use it withhin c# ? or have both languages coexisting?
9 Replies
Angius
Angius2y ago
IronPython maybe Or just calling Py scripts from C#
Korbah
Korbah2y ago
for a past project I invoked Python scripts through the executable using Process.Start
Dropps
Dropps2y ago
its more about having a python module (image converter and some more advanced stuff with image manipulation automated) but using it in a C# file so i can say
using App.SomePythonModule;
...
SomePythonModule pythonmodule = new();
pythonmodule.SomeMethodInThere();
...
using App.SomePythonModule;
...
SomePythonModule pythonmodule = new();
pythonmodule.SomeMethodInThere();
...
Thinker
Thinker2y ago
Unless you find some magic Python to IL converter, that's not possible
Dropps
Dropps2y ago
ah allright then ima just rewrite 7 packages i use in py to C# and my python code to C# then it should work :WishMeLuck: ah no nitro anymore still thanks alot for your help
Thinker
Thinker2y ago
I mean you can try using IronPython, but you'll never be able to fully use Python modules as if there were C# classes.
Dropps
Dropps2y ago
yes thats what i kinda need to achive
Thinker
Thinker2y ago
You could also try checking out ImageSharp if you need advanced image manipulation
Dropps
Dropps2y ago
need to create a BitMap from an video file repeatenly for each frame and then well process it to remove any kind of epileptic screen contents i want to create a filter against those basicly or i just let someone else do it from my team xD