#

#

# IronPython 1.0 Beta

IronPython is the code name of the beta release of the new Implementation Running on .NET of the Python programming language. The .NET Framework is a managed programming model for Windows; Microsoft standardized part of it in ECMA several years ago as the Common Language Infrastructure and C# Language Specification standards.

IronPython is fast - up to 1.8x faster than Python-2.4 on the standard pystone benchmark. It supports an interactive interpreter with fully dynamic compilation. It is well integrated with the rest of the framework and makes all .NET libraries easily available to Python programmers.

IronPython 1.0 Beta is a beta release. It is suitable for experimenting and playing with; however, a large amount of testing, packaging and library development remains to be done before a production-quality IronPython-1.0. We want to be sure to release IronPython in this early state in order to encourage feedback and discussion in the community of IronPython's features and designs as early as possible so that we can incorporate that into the final 1.0 design.

## Prerequisites

To run, IronPython 1.0 Beta requires .NET Framework version 2.0 to be installed on your system. You can install the latest version from Microsoft:

- Microsoft .NET Framework Version 2.0 Redistributable Package

IronPython should also run on any platform that implements the CLI specification v2.0.

There are more prerequisites if you want to build IronPython from source.

## Running IronPython

After unpacking the distribution of IronPyhon, you can complete the installation by adding the IronPython installation directory to your PATH. To test the installation, you should launch the interactive interpreter as shown below:

    C:\IronPython>IronPythonConsole
    IronPython 1.0 Beta on .NET 2.0.50727.42
    Copyright (c) Microsoft Corporation. All rights reserved.
    >>> 2+2
    4

You can use IronPython to run Python scripts by passing the script name on the command-line just as with standard Python. Most of the standard Python library is not currently implemented, so it is unlikely that many existing Python scripts will run successfully under this release of IronPython 1.0 Beta:

    Hello.py:

    for i in range(3):
        print "Hello World"

    C:\IronPython>IronPythonConsole Hello.py
    Hello World
    Hello World
    Hello World

This simple example shows how you can start using WinForms from IronPython:

    C:\IronPython>IronPythonConsole
    IronPython 1.0 (Beta) on .NET 2.0.50727.42
    Copyright (c) Microsoft Corporation. All rights reserved.
    >>> import clr
    >>> clr.AddReference("System.Windows.Forms")
    >>> import System.Windows.Forms as WinForms
    >>> WinForms.MessageBox.Show("Hello", "Hello World")
    OK

For more information on clr.AddReference function, see the Loading .NET Libraries exercise in the IronPython Tutorial.

## Building IronPython from Source

To compile the IronPython 1.0 Beta from the source code, you can install either Visual Studio 2005 or .NET Framework 2.0 SDK using one of the following links:

- .NET Framework 2.0 Software Development Kit (SDK) (You must install Microsoft .NET Framework Version 2.0 Redistributable Package prior to installing the SDK)
- Visual Studio 2005

IronPython can be built using Visual Studio 2005 or .NET Framework 2.0 Software Development Kit (SDK)

### Building using Visual Studio 2005

Open IronPython.sln in the Visual Studio 2005 development environment and build (from menu: Build/Build Solution). Set IronPythonConsole as your startup project in the Solution Explorer.

### Building using .NET Framework 2.0 Software Development Kit

.NET Framework 2.0 SDK comes with the C# compiler and Microsoft's msbuild. After installing the SDK, open the .NET Framework SDK command prompt, go to the IronPython directory and execute:

    msbuild IronPython.sln

This will build IronPython.dll, IronMath.dll and IronPythonConsole.exe.