net core python_使用python从.netcore调用python脚本

我正在尝试让pythonnet在我运行在Linux上的.Net核心应用程序中工作。在

我提到了Python.Runtime.dll在我的.Net核心项目中。在

我的代码是:using System;

using Python.Runtime;

namespace pythonnet_w

{

class Program

{

static void Main(string[] args)

{

Console.WriteLine("Start");

using (**Py.GIL()**) {

// blabla

}

Console.WriteLine("End");

}

}

}

我得到这个运行时错误:

^{pr2}$

试图在这些线索中找到解决方案,但没有任何运气:

更新:

我试图打开\pythonnet master\src\runtime**Python.Runtime.csproj**在visualstudio中查看是否可以将其编译为.Net或.Core,但我只能编译到.netframework。

我找到了这篇文章“How to port from .net framework to .net standard”

这就是我要做的吗?在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值