CPython,IronPython和Jython脚本相互兼容吗?
问题说明
我很确定python脚本在这三个脚本中都可以使用,但是我想确保.我在这里和那里已经读到了有关可以编写CPython,Jython,IronPython的编辑器的信息,我希望我能对此有所作为.
I am pretty sure that python scripts will work in all three, but I want to make sure. I have read here and there about editors that can write CPython, Jython, IronPython and I am hoping that I am looking to much into the distinction.
我的情况是我要测试3种不同的api.每个api在功能上均执行相同的功能代码,但实现方式不同.我正在围绕每种语言的api编写包装器.每个包装器都应使用Boost :: python,Jython和IronPython向python提供完全相同的功能和实现.
My situation is I have 3 different api's that I want to test. Each api performs the same functionality code wise, but they are different in implementation. I am writing wrappers around each language's apis. Each wrapper should expose the exact same functionality and implementation to python using Boost::python, Jython, and IronPython.
我的问题是,使用这些公开方法(每种语言通用)编写的python脚本是否可以在Python的所有三个风格"中使用?
My question is, would a python script written using these exposed methods (that are common for each language) work in all three "flavors" of Python?
就像我说的那样,我很确定答案是当然",但是我需要确保在花太多时间来解决这个问题之前.
Like I said I am pretty sure the answer is 'Of course,' but I need to make sure before I spend too much time working on this.
正确答案
简短的答案是:有时.
基于IronPython构建的某些项目可能无法与CPython一起使用,并且某些用C编写的CPython模块(例如NumPy)将不适用于IronPython.
Some projects built on top of IronPython may not work with CPython, and some CPython modules that are written in C (e.g. NumPy) will not work with IronPython.
类似地,尽管Jython实现了语言规范,但它与CPython有一些不兼容(例如,它缺少CPython标准库的某些部分,并且可以导入Java标准库包和类,例如Swing)
On a similar note, while Jython implements the language specification, it has several incompatibilities with CPython (for instance, it lacks a few parts of the CPython standard library, and it can import Java standard library packages and classes, like Swing)
所以,是的,只要您避免不兼容.
So, yes, as long as you avoid the incompatibilities.
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcfkjjb
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20