views:

141

answers:

4

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.).

+1  A: 

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).

SimonJ
Note: IronPython struggles with many of these things, e.g. Pylons and Django
Rafe Kettler
True, was referring more to Python in general - it makes sense to choose an implementation that best fits the task in hand.
SimonJ
Absolutely. I think CPython would work well for RDBMS.
Rafe Kettler
+4  A: 

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.

Rafe Kettler
@Rafe: I am not getting how can IronPython be a pure implementation when it is backed by .NET.
RPK
@RPK: I assumed "pure" meant in the sense that the language it understands *is* Python, as opposed to Boo, Cobra, etc. which alter and extend Python's syntax.
SimonJ
@RPK: Python is a language, not an implementation. It can run under a number of different things, whether it is C (CPython), the Java virtual machine (Jython), or the .NET common language runtime (IronPython). No implementation is more or less pure than the others, they are all derived off a common language specification for Python.
Rafe Kettler
+1  A: 

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.

TokenMacGuy
@Token: Just starting to learn but soon want to write a professional application using it. By "pure" I mean that probably the original Python libraries may not work with IronPython. And also, if I just learn IronPython, will I fit for a plain Python job?
RPK
+1  A: 

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)

ultimatebuster