简体   繁体   English

用什么机制将python与其他语言(.Net,Java…)集成在一起

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

Somebody talking the python's code can embed into C#'s code. 有人说python的代码可以嵌入到C#的代码中。 What 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. .Net / CLR语言 -Iron Python提供了在CLR上运行的Python的实现。 Allows you to use other CLR assemblies and embed a python scripting engine in your code 允许您使用其他CLR程序集并将python脚本引擎嵌入代码中
  • 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 基于Java / JVM的语言 -Jython在JVM上提供了一个实现,并允许您使用Java类并使用JSR 223作为脚本语言调用jython进行调用-Java平台的脚本
  • 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. C / C ++ / Perl / etc等 简化的包装程序和接口生成器使您可以在基于C的语言和其他语言(包括.Net和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 对于C ++,C和COM来说非常好-其他语言有点麻烦-但值得一试,看看是否需要将CPython与.Net或Java结合使用

Use IronPython for integration with .net. 使用IronPython与.net集成。 Likewise, Jython integrates with Java. 同样, Jython与Java集成。

还有Jython与Java集成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM