开发者

What the mechanism use to integrate python with other languages (.Net, Java ....)

开发者 https://www.devze.com 2022-12-12 08:24 出处:网络
Somebody talking the python\'s code can embed into C#\'s code. Wha开发者_如何学编程t the mechanism to do that? please explain for me.

Somebody talking the python's code can embed into C#'s code. Wha开发者_如何学编程t the mechanism to do that? please explain for me.

Thanks a lot


There are several approaches to this, depending on which languages you want to interoperate with.

  • .Net/CLR Languages - Iron Python provides an implementation of Python running on the CLR. Allows you to use other CLR assemblies and embed a python scripting engine in your code
  • Java/JVM Based Languages - Jython provides an implementation on the JVM and allows you to use Java classes and call to call into jython as a scripting language using JSR 223 - Scripting for the Java Platform
  • C/C++/Perl/etc, etc The Simplified Wrapper and Interface Generator allows you to interop between C based languages and others, including .Net and Java. It's very good for C++, C and COM - other languages are little trickier - but worth checking out if you need to use CPython with .Net or Java


Use IronPython for integration with .net. Likewise, Jython integrates with Java.


And Jython for integration with Java.

0

精彩评论

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