开发者

Would IronPython allow me to use Python in a C# Project without adding new requirements for deployment?

开发者 https://www.devze.com 2023-01-28 00:40 出处:网络
I have looked at the IronPython website and done various Google searches as well as searching answers on SO and am still not sure about this.

I have looked at the IronPython website and done various Google searches as well as searching answers on SO and am still not sure about this.

I want to use Python within a C# ASP.NET MVC project such that once the project is deployed I don't need to have Python running on the server that is hosting the application.

I think that is what IronPython does but I am not certain because the description does not seem very specific (or I am just an epic noob).

I could define an object in C# that would basically contain Python scripts, right? Perhaps this 开发者_运维技巧all seems to good to be true which is why I am asking, is there a catch here?


You don't need to have a Python interpreter installed. All you need is the DLR and the IronPython assemblies deployed with your site. Then you could host IronPython inside your application and execute Python scripts and even retrieve the results back in C#.

And here's an example of hosting the DLR in a console application.

0

精彩评论

暂无评论...
验证码 换一张
取 消