IronPython 是 100% 纯 Python 变体吗?

发布于 2024-09-30 02:17:12 字数 329 浏览 1 评论 0原文

我刚刚从 Python 网站下载了原始的 Python 解释器。我只是想学习这种语言,但首先,我想编写由任何 RDBMS 提供支持的基于 Windows 的独立应用程序。我想像任何典型的 Windows 设置一样捆绑它。

我搜索了 SO 上的旧帖子,发现有人建议 wxPython 和 py2exe。除此之外,很少有人建议使用 IronPython,因为它是由 .NET 提供支持的。

我想知道 IronPython 是 Python 的纯变体还是修改后的变体。其次,Python的实际用途是什么?它适用于 PHP 之类的东西还是 C# 之类的东西(您可以编写基于 Windows 的应用程序或 Web 程序)。

I just downloaded the original Python interpreter from Python's site. I just want to learn this language but to start with, I want to write Windows-based standalone applications that are powered by any RDBMS. I want to bundle it like any typical Windows setup.

I searched old posts on SO and found guys suggesting wxPython and py2exe. Apart from that few suggested IronPython since it is powered by .NET.

I want to know whether IronPython is a pure variant of Python or a modified variant. Secondly, what is the actual use of Python? Is it for PHP like thing or like C# (you can either program Windows-based app. or Web.).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

玩世 2024-10-07 02:17:12

IronPython 不是 Python 的变体,它就是 Python。它是基于.NET框架的Python语言的实现。所以,是的,它是纯Python。

IronPython 赶上了 CPython(您可能习惯的实现)2.6,因此 Python 2.7 或 3.x 中看到的一些功能/更改将不会出现在 IronPython 中。另外,标准库有点不同(但你失去的东西会被 .NET 提供的所有东西所取代)。

IronPython 的主要应用是编写用 C# 等编写的 .NET 应用程序脚本,但它也可以独立使用。 IronPython 还可用于使用 SilverLight 框架编写 Web 应用程序。

如果您需要访问 .NET 功能,请使用 IronPython。如果您只是想制作 Windows 可执行文件,请使用 py2exe。

更新

对于编写基本的 RDBMS 应用程序,只需使用 CPython(原始 Python),它更具可扩展性且速度更快。然后,您可以使用多种工具使其在 Windows PC 上独立运行。不过,目前只需担心学习 Python(如果您选择转换,这些技能将大部分转移到 IronPython)和编写应用程序。

IronPython isn't a variant of Python, it is Python. It's an implementation of the Python language based on the .NET framework. So, yes, it is pure Python.

IronPython is caught up to CPython (the implementation you're probably used to) 2.6, so some of the features/changes seen in Python 2.7 or 3.x will not be present in IronPython. Also, the standard library is a bit different (but what you lose is replaced by all that .NET has to offer).

The primary application of IronPython is to script .NET applications written in C# etc., but it can also be used as a standalone. IronPython can also be used to write web applications using the SilverLight framework.

If you need access to .NET features, use IronPython. If you're just trying to make a Windows executable, use py2exe.

Update

For writing basic RDBMS apps, just use CPython (original Python), it's more extensible and faster. Then, you can use a number of tools to make it stand alone on a Windows PC. For now, though, just worry about learning Python (those skills will mostly carry over to IronPython if you choose to switch) and writing your application.

再见回来 2024-10-07 02:17:12

IronPython 是一个用 C# 编写的独立 Python 实现,而不是原始实现,通常称为 CPython,因为它是用 C 编写的(毫不奇怪)。Python

是多用途的 - 您可以使用它来编写 Web 应用程序(通常使用框架,例如 DjangoPylons)、GUI 应用程序(正如您所提到的)、命令行工具以及嵌入用其他语言编写的应用程序中的脚本语言(例如 3D 建模工具 Blender 可以使用 Python 编写脚本)。

IronPython is an independent Python implementation written in C# as opposed to the original implementation, often referred to as CPython due to it being written in (no surprise) C.

Python is multi-purpose - you can use it to write web apps (often using a framework such as Django or Pylons), GUI apps (as you've mentioned), command-line tools and as a scripting language embedded inside an app written in another language (for instance, the 3D modelling tool Blender can be scripted using Python).

无法回应 2024-10-07 02:17:12

“纯Python”是什么意思?如果您谈论的是用 Python 实现的,就像模块可能是纯 Python 一样,那么就不是,也没有 Python 实现。如果您的意思是“与 cPython 兼容”,那么是的,编写 cPython 的代码可以在 IronPython 中运行,但有一些注意事项。最重要的可能是库不同,例如依赖于 ctypes 或 Tkinter 的代码将无法工作。另一个区别是 IronPython 落后于 cPython 一点。本文的最新版本是 2.6.1,Alpha 版本也支持一些可用的 2.7 语言功能。

你真正需要什么?如果您想学习使用 python 编程,并且还想为 Windows 生成代码,您可以使用 IronPython,但您也可以使用 cPython 和 py2exe;两者都同样适用,只是库有所不同。

what does "Pure Python" mean? If you're talking about implemented in Python in the same sense that a module may be pure python, then no, and no Python implementation is. If you mean "Compatible with cPython" then yes, code written to cPython will work in IronPython, with a few caveats. The one that's likely to matter most is that the libraries are different, for instance code depending on ctypes or Tkinter won't work. Another difference is that IronPython lags behind cPython by a bit. the very latest version of this writing is 2.6.1, with an Alpha version supporting a few of the 2.7 language features available too.

What do you really need? If you want to learn to program with python, and also want to produce code for windows, you can use IronPython for that, but you can also use cPython and py2exe; both will work equally well for this with only differences in the libraries.

梓梦 2024-10-07 02:17:12

IronPython 是使用 C# 的 Python 实现。这就像 Jython 使用 Java 实现 Python 一样。您可能需要注意,IronPython 和 Jython 在开发方面总是会落后一点。但是,您确实可以从拥有一些标准 Python 库中不可用的库中受益。在 IronPython 中,您将能够访问一些 .NET 内容,例如 System.Drawings 等,尽管通过使用这些非标准库,将您的代码移植到其他平台。例如,您必须安装 mono 才能在 Linux 上运行用 IronPython 编写的应用程序(在 Windows 上您将需要 .NET Framework)

IronPython is an implementation of Python using C#. It's just like the implementation of Python using Java by Jython. You might want to note that IronPython and Jython will always lag behind a little bit in development. However, you do get the benefit of having some libraries that's not available in the standard Python libraries. In IronPython, you will be able to get access to some of the .NET stuff, like System.Drawings and such, though by using these non-standard libraries, it will be harder to port your code to other platforms. For example, you will have to install mono to run apps written in IronPython on Linux (On windows you will need the .NET Framework)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文