Is Python suitable for some binary file editing?

Tim Hammerquist tim at vegeta.ath.cx
Tue Dec 4 21:54:03 EST 2001


David Rollo <drollo at cns.net.au> graced us by uttering:
> I am considering as a beginning Python project an iterative task
> involving conversion of a set of image files to an alternative format.
> The file conversion is simply making the same change to a handful of
> characters at a particular offset, and saving under a new filename. It
> would be repeated several thousand times, looping through a hierarchical
> directory structure in Windows, editing and renaming as it went.
> 
> Does this sound like the sort of task that Python is suited to? I had
> planned to do it in Java, but wondered if this might be the time to cut
> teeth in Python.

This not only sounds like a job better done in Python, it sounds like
_fun_ to do in Python.

Remember to use binary mode on Win32!

HTH
Tim Hammerquist
-- 
Most people are other people. Their thoughts are someone else's
opinions, their lives a mimicry, their passions a quotation.
    -- Oscar Wilde



More information about the Python-list mailing list