The Voidspace IronPython Pages

Articles & Information on IronPython

IronPython in Action

 

 

Python is an Open Source, cross-platform, high level, strongly and dynamically typed, interpreted [1] language. IronPython is the Microsoft implementation of Python, in C#, which has full integration with the .NET platform and is available under a sane permissive license.

The Python 'philosophy' emphasises readability, clarity and simplicity, whilst maximising the power and expressiveness available to the programmer. The ultimate compliment to a Python programmer is not that his code is clever, but that it is elegant. For these reasons Python is an excellent 'first language', while still being a powerful tool in the hands of the seasoned and cynical programmer.

Python is a very flexible language and is widely used for many different purposes.

A programming language is a medium of expression - Paul Graham

IronPython in Action is a book that I am writing, along with my colleague Christian Muirhead, for Manning Publications. The first chapter is available for free download and more is available via the Manning Early Access Program. The early chapters are an introduction to .NET, a Python tutorial, and then a walkthrough creating an example structured Python application. The rest of the book will cover working with various parts of the .NET framework (ASP, databases, web services, working with Windows and so on), getting deeper into Python (testing, protocols, metaclasses and so on) and also embedding and extending IronPython.

IronPython Articles

  • DLR Hosting: Embedding IronPython

    A couple of simple examples, with explanation, of embedding IronPython (or any DLR language) in a C# .NET application. Enjoy the IronPython Calculator and the IronPython Evaluator.

  • Simple Server

    A Simple HTTP Server using the HttpListener class. This article also touches on text encoding, asynchronous callbacks, URI and XHTML escaping, the system message box, and creating a simple Windows Forms dialog. If you are new to .NET, this is a valuable tour of parts of the .NET 'standard library'.

  • Dynamically Compiling C# from IronPython

    There are some things you can't do from IronPython, most notably applying .NET attributes to classes and methods. One approach to solving this is to create stub C# classes. This article shows you how to compile dynamically generated C# to in-memory (or on disk) assemblies and then import them into IronPython - all from IronPython code.

  • Profiling IronPython

    Some example code (timers) for profiling IronPython code.

  • Embedding IronPython

    A simple example of embedding the IronPython engine into a dotnet application. In this example (taken from the Tabbed Image Viewer) IronPython 1 is embedded in C# to create a custom executable.

  • The CPython Server

    A local server that executes arbitrary CPython code sent to it in a POST request. It can send any response which can be read from IronPython. This is one (hacky!) way in which IronPython can be interfaced to CPython, and use Python modules that aren't available to IronPython.

    The example in this articles uses matplotlib to generate charts, which are displayed from an IronPython application.

  • Threading with IronPython & Asynchronous Exceptions

    A discussion of asynchronous exceptions (and aborting threads), and some simple examples of threading in IronPython.

  • Embedding IronPython... in IronPython

    Examples of playing with (and configuring) the PythonEngine class, from inside IronPython! This shows how to use the basic parts of the IronPython 1 Engine API, including:

    • creating and setting modules
    • putting objects into module globals
    • diverting standard output
    • executing code
  • Using CPython Extensions from IronPython

    An experimental approach, using the CPython interpreter wrapper from Python.NET, to enable you to use CPython extensions from IronPython. It has several limitations, but works!

  • Python-System

    An implementation of the BCL and other .NET libraries in pure Python (for porting IronPython code to CPython). The goal is for 'compatible but not necessarily complete' implementations of the classes (etc) needed to get Resolver One spreadsheets, exported as code, to run under CPython (and as part of Python applications).

  • Functional Testing of Desktop Applications

    An article on functional testing of GUI applications - with the examples written using IronPython and Windows Forms (with downloadable example application with testing framework and functional tests).

Presentations

Slides from a few presentations I've done on IronPython. Most of the information in these slides are also in the articles, which tend to be easier to read.

These slides are all S5 Javascript and HTML presentations. If you click on the big '0' link at the bottom right of each slide, you can view the presentation as a single page with my notes visible.

IronPython & Silverlight is a series of articles (with code examples) on using IronPython with the Microsoft browser plugin Silverlight. Silverlight can be used for media streaming, games and rich internet examples.

IronPython and Windows Forms is series of tutorials on using Windows Forms with IronPython.

Planet IronPython is an aggregation of blogs from developers who regularly use and comment on IronPython related topics.

The IronPython Cookbook is a Wiki full of examples of using IronPython and .NET. It has useful recipes on interacting with Excel and IIS, Direct3D and XNA, working with databases, network protocols and much more!

For my day job I work at Resolver Systems. We are creating an application development tool with a spreadsheet interface using IronPython. It is free for non-commercial and Open Source use. For more information about how Resolver One works, and some of the cool things you can do with it, visit Resolver Hacks.

Tabbed Image Viewer is an example application demonstrating Windows Forms, using a variety of controls in 18k of source code, including a really funky about dialog. It also has C# showing a custom executable (the simplest example of embedding the IronPython engine) and creating a C# class and then using it from IronPython.

IronPython-URLs is a blog aggregating articles, news and links on IronPython and the Dynamic Language Runtime. I maintain it, with occasional contributions from Mark Rees and Seo Sanghyeon.

Fepy is the community edition of IronPython. There are compiled binaries for Mono, extra standard library modules and patches that haven't yet been integrated into the official Microsoft release.

My blog regularly includes entries about IronPython. You can see the most recent IronPython entries in the IronPython Category, and all the IronPython posts from the All by Category Page.


[1]Python programs are actually compiled to byte-code before being executed, but the byte-code is then interpreted. In some ways this is similar to Java or .NET which also compile to byte-code. Because these languages are statically typed with JIT compilers, they are generally considered as compiled languages whilst Python is generally considered as being interpreted.

For buying techie books, science fiction, computer hardware or the latest gadgets: visit The Voidspace Amazon Store. If you're looking for a new techie job, try the Voidspace Tech Job Board. This is part of the Hidden Network of technology and programming jobs.

Hosted by Webfaction

Return to Top

Page rendered with rest2web the Site Builder

Last edited Thu Sep 18 22:51:59 2008.


Counter...


Voidspace: Cyberpunk, Technology, Fiction and More
Search this Site:
 
Web Site

IronPython in ActionIronPython in Action

Blogads

Follow me on:

Twitter

Pownce

Jaiku

Del.icio.us

Shared Feeds

Tech Jobs

Hidden Network

Tech Jobs Board

Hosting for an agile web