IronPython for .NET core
Asked Answered
L

1

17

I'm developing a windows 10 universal app in VS15 using the new .NETCore reference assemblies and want to reference the IronPython library. Unfortunately, IronPython targets .NETFramework and not .NETCore. Does anybody know of an alternative library for running python scripts within .NET using C#, a way to make IronPython portable, or a way to work around the project targeting .NETCore? Other possible solutions welcomed. Also does anybody know whether IronPython will become .NETCore compatible/if that's possible? Thank you. PS I am trying to execute very simple python scripts and display the interpreter's output.

Lenzi answered 31/7, 2015 at 19:26 Comment(5)
I'm interested too! For the moment i'm using DynamicLINQ and runtime compiled lambdas.Percentile
@lexLi c# is not really dynamic now, it is jsut better compile and executable as script/ at runtime.Er
Considering that the last release / blog post is from late 2014 (before the .NET Core announcement even) I would consider this project as dead. So in my perspective there will be no port and it would not be a good decision to integrate this library into a production scenario.Dana
The DotNet Core team should really focus on Bringing Iron Python to DotNet core. Much functionality is still missing in DotNet Core (Like image manipulation). Cloud services like Azure, AWS, etc support running .Net, Pyhon, and PHP on the same Application. If we had Iron Python we could do Image stuff in OpenCV on Python and everything else on DotNet Core. It would be good to get us by while more things are made for DotNet Core.Islet
@AlfredYoung Do you need to interact with the python script much or just send some arguments? If you just need to run it and get the result, I think the System.Diagnostics.Process and ProcessStartInfo classes that are included in the .Net core will allow you to run python scripts command line style.Roughen
C
10

The IronPython-Team just released the beta of IronPython 2.7.8 supporting mono and .net core:

more infos here: https://github.com/IronLanguages/ironpython2/releases

There is also a nuget package IronPython. You probably need to switch from Stable only to Include Prerelease

IronPython 3 with support for mono and .net core is still in progress.

Update: with IronPython 2.7.10, the IronPython-Team added support for .NET Core 3.1.

Cleodal answered 1/12, 2017 at 12:56 Comment(4)
2 year update, Iron Python 3 is still "in progress". The repo is marked with a giant DO NOT USE banner.Arleyne
@ChrisMarisic thats correct. for me, the v2.7 does its job.Cleodal
It really bites that IronPython 2.7 does not support writing dotnetcore DLLs (clr.Compile) or Python 3.x yet. Specifically I can't find any way to generate a pygments.dll that is compatible with dotnet core. Would love any ideas...Fem
2.7.10 is released! This release adds .NET Core 3.1 support. github.com/IronLanguages/ironpython2/releases/tag/ipy-2.7.10Marienthal

© 2022 - 2024 — McMap. All rights reserved.