Python Programming, news on the Voidspace Python Projects and all things techie.
PyCon UK and Mix UK Photos
Unfortunately I forgot my camera at both the PyCon UK Mix UK conferences I attended recently. Luckily other people weren't so dopey.
A picture of me giving my presentation at PyCon UK, from Chris Miles:
Resolver Screencast: Web Application in Ten Minutes
Giles has put up a ten minute screencast of Resolver in action. As you will probably guess from the title, it covers both the desktop version and the web server.
If after all my descriptions you still haven't got a clue what Resolver is actually for, this shows off some of the best features in just ten minutes.
If this whets your appetite, you can still sign up for the Resolver beta program. The next phase of the beta is still a couple of weeks away, but shouldn't be much longer.
Python Interactive Interpreter in a Browser
Ok, so I lied. One more entry on Silverlight. I've got a proof of concept 'Interactive Interpreter in the Browser' working with IronPython & Silverlight. There are lots of ways it could be improved (I'll discuss these in a minute), but it is still quite fun.
This could be embedded into web based tutorials (like Crunchy) to provide live examples. Because the Python code executes in the browser (not on the server) there are no security issues to worry about. It doesn't actually use the Silverlight canvas, just an HTML textarea and text input field, so you could have several in a page if you wanted. You could also prepopulate the namespace(s) with live objects.
It has several limitations, most of which someone (you?) could fix and one of which will have to wait for the next update to Silverlight. If you fancy downloading it as it is, head over to my IronPython & Silverlight Page.
- It would be greatly improved by being in a single textarea field. Only the last line after the prompt should be editable. This is fiddly to do in a cross-browser way, but not very difficult .
- Evaluated expressions aren't shown as they are in the 'normal' interactive interpreter (you have to use print to see the result). This is actually due to a bug in IronPython 2, which will be fixed in the next release (basically a one line fix!) !.
- You have to provide the standard library if you want it to be available!
- In Silverlight the file type doesn't exist (for a good reason), so more stuff than usual is broken.
Note that this does use some standard library modules, which I've modified slightly to work with IronPython & Silverlight. These are included in the download.
|||Some of the editing code could be borrowed from PyShell which is a wxPython interpreter widget that operates in a control very similar in appearance to a textarea. It also uses the Python standard library code module.|
|||There is code in the DLRConsole IronPython example which could be used if you are desperate to get a working version of this. It takes a very different approach and so would be a lot more code - but the source code is very readable if you are prepared to work with the DLR API.|
IronPython & Silverlight Articles & Resources
Ok, last post on Silverlight for a while.
I've turned my PyCon / Mix UK talks into a series of articles. You can access the articles, downloads and online examples from:
The articles are:
- Introduction to IronPython & Silverlight
- An IronPython Silverlight Application
- The Silverlight APIs
- Embedding IronPython in a C# Silverlight Application
For Mix I added a couple of extra examples to the Web IDE:
You can download the source files from the main articles page.
This work is licensed under a Creative Commons Attribution-Share Alike 2.0 License.