{infiniteZest}
// Articles. Tutorials. Utilities.
Home  |   Search  |   Login  
Categories Skip Navigation Links
New / All
AJAX
Apple
ASP.NET
.NET
Git
Google / Android
Python / IronPython
Miscellaneous
SQL Server
IronPython – the basics and getting started
Summary
These are my notes on getting and setting up and playing with IronPython version 1.x and 2.x.
 
Table of Contents

What is IronPython (very briefly)

Where to get IronPython?

Installation

Figure 1: The Python directory structure

The Binaries

Figure 2: IronPython Console

With Visual Studio 2008

Figure 3: IronPython Console from Visual Studio 2008

Target Framework

Figure 4: Target Framework for IronPython

 

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:

http://www.codeplex.com/IronPython/Wiki/View.aspx

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:

  • IronPython-2.0A4-Src.zip
  • IronPython-2.0A4-Src.zip

Installation

Installation is a simple matter of picking a directory and unzipping the above files.

Figure 1: The Python directory structure

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 Binaries

The IronPython.sln is a Visual Studio 2005 solution file. It includes the IronPython projects:

  • IronMath
  • IronPython
  • IronPythonConsole
  • IronPythonTest
  • IronPythonWindow

Compiling the IronPython.sln solution file produces the following binaries:

  • ipy.exe
  • ipyw.exe
  • IronMath.dll
  • IronPython.dll

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

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

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.

Target Framework

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

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.

Bookmark and Share This

More Articles With Similar Tags
icon-ironpython-in-aspnet.jpg
This is my first look at installing IronPython for ASP.NET and playing with it a little bit.
Top Tags in Related Articles
aspnet dynamic language ironpython
About  Contact  Privacy Policy  Site Map