简体   繁体   中英

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

Somebody talking the python's code can embed into C#'s code. 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. 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.

还有Jython与Java集成。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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