Python in your Browser with Silverlight
Code & Examples for IronPython & Silverlight
Silverlight Articles & Examples
Follow my exploration of living a spiritual life and finding the kingdom at Unpolished Musings.
This is a series of articles and code examples for using IronPython with Silverlight. For more details on working with IronPython and Silverlight, you need IronPython in Action.
These articles will take you through everything you need to know to get started writing Silverlight applications with IronPython:
Exploring the CoreCLR that comes with Silverlight. This includes accessing the browser DOM, working with XAML, creating controls, the video player, accessing server resources, using local storage and more.
An interactive Python interpreter that runs in the browser, inside an HTML textarea. Great for documentation and tutorials where you can try the code in the browser.
You can download several of the examples used in the articles:
- View Minimal IronPython Example 1 Online (with XAML)
- Download Minimal IronPython Example 1
- View Minimal IronPython Example 2 Online (pure-Python)
- Download Minimal IronPython Example 2
- View IronPython Controls Example 1 Online (from XAML)
- Download IronPython Controls Example 1
- View IronPython Controls Example 2 Online
- Download IronPython Controls Example 2
- View Simple Animation Example Online
- Download Simple Animation Example
The easiest way of experimenting with the Silverlight APIs is through the Web IDE:
The following downloads use C#:
- Visual Studio 2008 Project Using the Scriptable Attributes
- Compiling C# from the Command Line (batch file)
- Embedded IronPython Project
One of the most exciting things about Silverlight is the possibility of embedding an interactive interpreter inside web pages:
This is an online example of working with the Silverlight APIs. It presents you with a Silverlight Canvas and a Python editor. You can execute code in the editor and experiment with the canvas or the Silverlight APIs. Anything you print (and errors) will go to the debugging pane at the bottom of the page.
The Silverlight canvas is preloaded with several different examples. The article that goes with this demo is Exploring Silverlight APIs.
You can also download the latest version of the Web IDE:
This is a proof of concept 'Interactive Python Interpreter in the Browser' which could be embedded into web based tutorials and documentation (like Crunchy) to provide live examples. For more details read Interactive Python Interpreter in the Browser.
Useful resources for dynamic silverlight development:
Currently for Mac OS X and Windows, for IE, Safari and Firefox browsers.
Documentation for IronPython and Silverlight.
Quickstart guide: Programming Silverlight with Dynamic Languages
Jimmy is the Microsoft man in charge of the Silverlight dynamic languages integration. He often blogs interesting things about Silverlight and his website
This example only works with Silverlight 1.1 Alpha Refresh. (Mainly due to the fact that the API for using the IronPython parser has been changed.)
'Resolver in the Browser' is an example of an application that just uses Silverlight for the business logic. It is described in The Silverlight APIs page.
For buying techie books, science fiction, computer hardware or the latest gadgets: visit The Voidspace Amazon Store.
Last edited Sat Aug 14 14:28:51 2010.