From IronPython Cookbook

Revision as of 13:48, 11 June 2009 by MichaelFoord (Talk | contribs)


The IronPython Cookbook

This wiki contains useful example code for working with IronPython and the .NET framework.

The internet is already awash with quality examples of Python code, but .NET examples for IronPython are only just starting to arrive - so this will be the main focus of the recipes here.

For more information and resources, see the Useful Links page.


You can download binaries and sources of IronPython 1.1.2, 2.0, 2.6 and FePy (IronPython Community Edition) from:

Adding Entries

If you want to add an entry, the easiest way is to add a link (in the relevant section) on this page, and then follow the link to create the new page. You will need to be logged in to edit pages, but setting up an account is easy.

If there isn't already an appropriate section, then add your link to Misc or create a new section.

If you need reminding about wiki markup format, there is a guide on the Help page. Or find an existing page on the wiki that looks like the one you want to make, click the Edit link and use that as a template.

Please note that for long examples and articles it is acceptable to link to external articles or blog entries. For shorter examples, please post them here on the Wiki.

Core Concepts

For the people involved, see People in IronPython.

IronPython in Action

IronPython in Action

IronPython in Action is a book on IronPython, written by Michael Foord and Christian Muirhead for Manning Publications.

The first five chapters are an introduction to .NET, a Python tutorial, and then a walkthrough creating an example structured Python application.

The rest of the book covers working with various parts of the .NET framework (ASP, databases, web services, WPF, shell scripting, working with Windows and so on), getting deeper into Python (testing, protocols, metaclasses and so on) and also embedding and extending IronPython.

Chapters 1 and 7 are free to download:

Pro IronPython

  • Pro IronPython Book from APress (written by Alan Harris and not yet published)


Getting Started


Windows Forms


For a good introduction to using IronPython with Silverlight (including code, live examples and downloads), visit The Voidspace Silverlight Pages.

  • Profiling - A quick and low-impact way to get some rudimentary performance data in a silverlight application.


SqlServer 2005 Management Objects

Network Protocols



Win32 & Windows Specific

System Administration and automation

.NET 3.0

Graphics & Multimedia


Note: most of the pages below are for embedding IronPython 1, or out of date tutorials for pre-release versions of IronPython 2. An up-to-date set of tutorials on embedding IronPython 2 (including interacting with dynamic objects) can be found at Embedding IronPython.



Tools and Utilities

  • Web IDE - Try out Python in your browser.
  • SilverShell - Slick IronPython Shell that runs in a browser and also on the desktop
  • IronEditor - Win Forms based editor for DLR based languages.
  • IronPython add-in - An IronPython add-in for Redgate's .Net Reflector Redgate
  • Davy's IronPython Editor - DIE (Davy's Ironpython Editor) is a clutter free IronPython code editor along the lines of SPE or DrPython.


These sections document the compatibility of various Python application and libraries with IronPython.