What is IronPython (very briefly)
Python is a popular dynamic programming language. This language is implemented on several platforms/environments (CPython, which is implemented in C, is de facto standard). IronPython is the .Net implementation of Python.
IronPython is developed in C#. Since it is an open source project, all the source is also available.
Where to get IronPython?
IronPython is hosted on CodePlex, the .Net/Microsoft site for hosting open source projects). The IronPython project is hosted at the following location:
At the time of this writing version 1.1 of IronPython has been released. And version 2.0 is in Alpha 4. I have downloaded and installed the zip files that contain the full source. Following are the zip files with source:
Installation is a simple matter of picking a directory and unzipping the above files.
Figure 1: The Python directory structure
As you can see in the above figure, the entire source for the IronPython compiler/interpreter is in the Src directory under the root of the IronPython-x.x directory.
If you have downloaded the Source version of the zip file, the binaries are not included. However, you can easily compile the entire source code and generate binaries. The solution file (named IronPython.sln) is in the Src directory.
The IronPython.sln is a Visual Studio 2005 solution file. It includes the IronPython projects:
Compiling the IronPython.sln solution file produces the following binaries:
If you want to run the IronPython console from Visual Studio, make sure to set the IronPythonConsole as the startup project.
Figure 2: IronPython Console
If you run (F5) IronPython.sln with IronPythonConsole as the startup project, you will see the IronPython console window as shown in the above figure. You can see the standard Python command prompt >>>.
With Visual Studio 2008
As of this writing Visual Studio 2008 is in beta. I am sure once VS 2008 is released, all these solutions/projects will be in VS2008. I just wanted to see if IronPython.sln can be compiled with VS2008.
Figure 3: IronPython Console from Visual Studio 2008
The Visual Studio Conversion Wizard which converts the solution files from VS2005 to VS2008 converts all the IronPython projects without any problem. And the binaries seem to work fine.
Unlike previous versions, with Visual Studio 2008, you can set the Target Framework to a version of .NET Framework (2.0, 3.0, or 3.5).
Figure 4: Target Framework for IronPython
As you can see from the Properties window of the IronPythonConsole project, when the IronPython projects have been run through the conversion wizard, they retain the 2.0 version of the .NET Framework. This is the most wonderful thing about Visual Studio 2008 – you get all the good things of the new IDE and you can move to the new .NET Framework version when you are ready.