Python Programming, news on the Voidspace Python Projects and all things techie.

IronPython Podcast on FLOSS Weekly and EuroPython Special on Linux Outlaws

emoticon:globesearch Two podcasts with interviews from me on IronPython have been posted this weekend!

The first is an interview with Randal Schwartz and Leo Laporte on FLOSS Weekly:

The podcast is a rambling discussion over about 45 minutes. We discuss topics like, the differences between IronPython and CPython, Ironclad for using Python C extensions from IronPython, Silverlight, the Dynamic Language Runtime (DLR) and so on.

The interview was good fun, but despite exchanging emails with them before the recording (which went out with a live videocast - much to my surprise) they seemed to not be clear what my connection with IronPython was! For the record I'm not a core IronPython developer but work for Resolver Systems who have the largest codebase of IronPython in production. I'm also one of the authors of the first book on IronPython (IronPython in Action) and I maintain the IronPython Cookbook Website and IronPython-URLs Blog. Smile

The second podcast is a Linux Outlaws episode called the "EuroPython special":

It features several interviews recorded at this year's EuroPython conference. Regular readers of this blog will probably recognise most of the names of the interviewees:

On this week's special show, Dan and Fab bring you a handful of interviews from Dan's visit to the EuroPython conference: Steve Holden, Laura Creighton, Bruce Eckel and Michael Foord. We also included the interview Moritz Schmidt-Degenhard from TuxTux did with us.

My part in the show is near the end and lasts about ten minutes or so but manages to cover some of the same ground as the FLOSS Weekly interview, with perhaps a bit more about IronPython on Mono.

  • 0:05:39 Steve Holden, Chairman of the Python Software Foundation (PSF) talks about the Foundation and what else he does in the open source world
  • 0:13:50 Laura Creighton from Open End talks about the EuroPython conference and also PyPy
  • 0:36:12 Bruce Eckel talks about writing technical books, writing them collaboratively and making books available for free on the web
  • 0:55:18 Michael Foord from Resolver Systems talks about IronPython and what he does with it at his work (including Ironclad) - also check out his book IronPython in Action

There's a fun comment on the part of the interview with Laura Creighton on the episode forum thread:

She was frighteningly enthusiastic about everything she said. Was Dan using a special interviewing technique, or was it something to do with all the wine she collects? No-one can be naturally that vivacious.

Yup that sounds like Laura, and it's all natural...

Like this post? Digg it or Del.icio.us it.

Posted by Fuzzyman on 2009-08-16 21:10:33 | |

Categories: , , Tags: , , ,


rst2xaml: ReStructuredText to XAML for WPF and Silverlight / Moonlight

emoticon:cat Something I've been working on in my 'spare' time:

FlowDocument XAML is used by the Microsoft Windows Presentation Foundation (WPF) user interface library which is part of .NET. More interestingly, the Silverlight browser plugin (and Moonlight for Linux) supports a subset of XAML for formatting text.

My goal is to be able to create Python tutorials from ReST source and display them in the browser, with an interactive Python interpreter for trying out the examples. This is what I would like Try Python to become anyway. I don't have any timeline for completing this of course. Smile

rst2xaml already supports a subset of ReStructured Text markup, but it is still much easier to list the things it does support rather than the ones it doesn't:

  • title and headings
  • paragraphs
  • blockquotes
  • bold and italics
  • superscript
  • literal blocks and inline literals
  • line blocks
  • bullet and enumerated lists
  • the pygments code-block directive

(Actually superscript is supported in theory, the Typography.Variants="Superscript" is generated correctly in the XAML, but doesn't work in practise. It requires support from the font in use and it may just be that the default font doesn't support superscript.)

Adding support for elements like images, hyperlinks, tables, sidebars and admonitions should be relatively straightforward. Unfortunately there is no support in FlowDocument XAML for internal links within a document as far as I can see. This means that rst2xaml will never support the full docutils specification. Here's a screenshot of a ReST document displayed with the wonderful high-level FlowDocumentReader class by IronPython and the example display_xaml.py script:

ReStructured Text document converted to FlowDocument XAML by rst2xaml and displayed from IronPython

rst2xaml runs under CPython but the XAML it outputs is intended for use from IronPython (although there is no reason not to use it from any .NET language of course). It requires both pygments and docutils to be installed.

Note

rst2xaml could run under IronPython. Pygments mostly works and the remaining bug in IronPython will be fixed in IronPython 2.6. If you use the unicodedata module from FePy then docutils also works under IronPython.

Unfortunately the subset of FlowDocument XAML supported by the Silverlight TextBlock is pathetic. No paragraphs, no lists, no images, no links and so on. Many of these problems are solvable by nesting textblocks in a StackPanel. I haven't gone very far down this line yet, so basically the only part of rst2xaml that works for Silverlight is the code-block directive:

Python source code highlighted by rst2xaml for Silverlight

There are three scripts that come with rst2xaml:

python rst2xaml.py source.txt output.xaml
python rst2xamlsl.py silverlight-source.txt silverlight-output.xaml
ipy.exe display_xaml.py output.xaml

The tests use the discover module, which is included in the repository for convenience. You run the tests with:

python discover.py

The currently failing tests are there as placeholders to remind me that I haven't implemented proper XML escaping yet...

Like this post? Digg it or Del.icio.us it.

Posted by Fuzzyman on 2009-08-15 00:04:26 | |

Categories: , , Tags: , , , ,


Hosted by Webfaction

Counter...