wxPython: How to combine StyledTextCtrl with pygments

Pygments is nice. It colorizes your code, has support for 1001 languages, and you can add your own highlighting scheme with just a few regular expressions. By default, it generates some HTML/CSS however, which is unusable within any editor component in your program. Here’s how to combine it with a StyledTextCtrl wxPython widget – the trick is to write a simle Formatter for pygments that wraps pygments’ default styles (or the ones you defined in your lexer) to some styles you have defined in your StyledTextCtrl. (code after the break)
(more…)

301 Moved Permanently

Location: Hønefoss, Norway
P1050785

Yup, that’s correct. I live and work in Norway now. For the curious among you, there are a few pictures of my new apartment - here -.

thought of the day

you know autumn has come when you see the skateboarders carry a sweeping broom to the park

De vuelta

2009-09-20_19_-98_P1050066
We’re back to Berlin (it’s actually just around the corner, you see?). The rest of the photos will take a while, until Jörg got the raw files converted into images. I will keep you informed. :)

Back from the Mountains

This writing, smiling buddha…

cuaji3cuaji2

…and me just spent two days/one night in Cuajimoloyas, in the Sierra del Norte near Oaxaca. The forests do not look uncommon, but at 3100m of altitude, walking was a challenge that left us well tired out.

Puerto Arista / Oaxaca

P1050046

We’ve just spent a few nice days in the sleepy village of Puerto Arista at José’s Cabañas.The Pacific coast is so much more impressive than all the white beaches in the Carribean. Real waves! We also went canoeing and birdwatching in the mangroves and watched the release of turtles from a turtle sanctuary. Reporting in from Oaxaca, Oaxaca now.. just arrived with the night bus.

Canyon del Sumidero

just some impressions from the canyon…

canyon1canyon4canyon3canyon2

Calakmul

Calakmul…is what we’ve visited the day before yesterday. An immense archeological site of about 100 km2 – only little of which has been made accessible yet. As it is a bit remote, we’ve been almost the only visitors. Also the smaller site of Balamku, where a colourful fresco can be seen, and toads have been venerated as beings able to wander between the real and the mystical worlds.

Reporting in from San Cristobal de las Casas, Chiapas today – which we’ve reached after an odyssey of buses, colectivos and differing informations.

it is bright…

P1040770

…in Tulum (but unfortunately not inexpensive enough to stay for long).

Campeche, Campeche

The view from our hostel rooftop terrace…
P1040709
..and in the other direction (the rain just started as I am typing)
P1040717