Can i use all standard Python libraries with IronPython or

人盡茶涼 提交于 2019-11-30 03:19:10

问题


... does it requires some sort of wrappers?

I was under expression that IronPython is a .NET implementation of the Python which somehow magically enables applications built with IronPython to use standard Python libraries (which I believe either a raw .py sources or .py source packaged into the eggs), but when I was reading http://www.doughellmann.com/PyMOTW/hashlib/index.html at the bottom of the page I spotted: "A wrapper for hashlib that works with IronPython." which immediately put me on guard...


回答1:


It depends:

  • If a library module is implemented in pure python, it is likely to work.
  • A library module that is implemented in C will not work. The ironclad project aims to allow IronPython to import and use compiled Python C extensions.



回答2:


No - you can't use all standard libraries. And even all existing IronPython standard libraries are not the same as in python - all of them are new implementation - for example you can use datetime python module but it doesn't have strptime implementation as in pure python and so on.

You can read more here and Does IronPython implement python standard library?

In general IronPython 2.6 is an implementation of Python 2.6 but not all standard python modules were migrated into the IronPython.

Also you can read the following IronPython vs. Python .NET



来源:https://stackoverflow.com/questions/6855211/can-i-use-all-standard-python-libraries-with-ironpython-or

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!