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



Blimey... lots has happened, lots of changes, and loads (well some) new stuff. Too much to mention it all. Minor happenings include me working on a new PyZine article on CGI programming and someone taking on updating the dateutils module. This is good news as dateutils is surprisingly popular, but badly in need of an overhaul. Hans Nowak has also made good progress on implementing plugins for firedrop. As soon as the dust settles I will finish building a spell checker for it (and fix all the typos in this blog).

PyZine and reST

PyZine are preparing a new issue. You can see the blurb for my new article on their front page. They're now using reST as their format for article submissions. But the editor (who is very good) uses a Mac. This means that the text file he returned to me as the 'first edit', had lots of weird characters in it. Luckily I've just got to grips with unicode in Python. I read the file into the python interpreter as a string, and then tried decoding it using all the 'Western European' standard encodings one by one. When I got to the 'macroman' encoding it finally looked normal. I then re-encoded it as 'UTF-8' and saved it out.

This illustrates the danger of assuming that saving something as plain text actually means anything ! It only means anything if you know what the encoding is.


ConfigObj has just had a major update to version 3.3.0. The new version features support for unicode, a funky new validation schema (co-written with Mark Andrews), and string interpolation. It also has numerous minor improvements, optimisations, and bugfixes. Lots of other modules have also had updates - listquote, caseless, linky, downman and approx.

I've finally packaged ConfigObj and associated modules using distutils. It's now available as the Voidspace Pythonutils Package. Doing this highlighted a problem with distutils and Python 2.4.

Problem with Distutils and Python 2.4

Python 2.4 is built with MSVC 7.1, aka MS Visual Studio .NET 2003. This means that it uses msvcr71.dll, which isn't a standard part of the windows operating system. This means that if you build a binary installer using distutils - it requires msvcr71.dll. This is true even if your package is a pure python package. This means that when someone tries to use a windows installer created with Python 2.4, on a machine with only python 2.3 - it will fail.

It's likely that nothing can be done about this (although for a pure python package like Pythonutils there's no reason not to use the 'source distribution' and the It means that I have to build my windows installer on a machine with python 2.3.

DVD Ripping

Something I've been putting far too much time into recently followed on from the discovery that my XDA [1] can easily play mpegs or even avis. This coincided with getting a 512mb SD card from Amazon for about 20 pounds. Thats as much as I paid for a 128mb card about 18 months ago !

I've had to learn about encodings and codecs once again - this time not unicode but the likes of DivX and other audio/video encoding techniques. Unfortunately ripping DVDs to a small mpeg wasn't easy.

I discovered a very powerful set of tools called Gordian Knot which promised to contain everything I needed (and much more) in a reasonably straightforward package. Once I had worked through the guides at Doom9, it did seem simple enough. Unfortunately the first film I went for had a very low volume and Gordian Knot seemed to offer no way to 'normalise' volume, like other tools did.

In the end I went back to a combination of CladDVD [2], followed by either FlaskMpeg [3] and TMpegEnc [4], or DVDShrink [5]. I couldn't get the latest version of FlaskMpeg to work so I used an older copy of version 0.6 that someone gave me. It's nice to be able to use almost entirely free and open source tools for this sort of thing.

[1]A PocketPC device with a 320x240 pixel screen
[2]CladDVD for ripping - although DVDDecryptor is also good
[3]FlaskMPEG will create AVIs from the ripped DVD. I use the Xvid codec
[4]TMpegEnc will re-encode the AVI as a smaller sized MPEG suitable for playing on a PocketPC device
[5]DVDShrink can be used for re-burning films back to DVD ahem for creating backup copies of course :-)

Like this post? Digg it or it.

Posted by Fuzzyman on 2005-03-09 19:36:32 | |

Categories: , ,

Hosted by Webfaction