3 ms·
I too use Python for my various noodlings where I don't have a pressing need to use some other language... or even if I do, I'll draft it in Python first to get
by thristian 15y ago
I too use Python for my various noodlings where I don't have a pressing need to use some other language... or even if I do, I'll draft it in Python first to get my head around the problem space then think about porting it later.
Some unusual stuff I've done in Python that I happen to have online:
https://gitorious.org/bdflib https://gitorious.org/bdflib is a library for working with bitmap fonts in the "BDF" file-format, one of the traditional X11 font formats. Among other things, given a font with some base glyphs and some combining glyphs, it can automatically generate all the pre-composed glyphs Unicode defines.
https://gitorious.org/macfontextractor https://gitorious.org/macfontextractor is a library for extracting FONT and NFNT resources from Mac OS Classic resource forks. It loads them into the data structures defined by bdflib above, so you can save them out to BDF files. Currently it only supports resource forks in MacBinary-encoded files, but it shouldn't be too hard to extend it to work with AppleSingle, AppleDouble and native resource-fork support.
https://gitorious.org/python-blip https://gitorious.org/python-blip (now renamed Python BPS, I couldn't change the URL) is a diff/patch tool for arbitrary binary files; a bit like bsdiff or xdelta. It produces less space-efficient diffs than bsdiff, and it's much slower than xdelta, but the BPS file-format is vastly easier to implement than either of those.
- mace 15y agoNot coincidentally, 'drafting' is what led me to first use Python. Prototyping and working out the architecture/logic of a piece of code is very fast in Python. Many libraries (standard and 3rd-party) are generally well-designed and are of a very high quality (ex. django, twisted, sqlalchemy, numpy)
- rogerbinns 15y ago> ... then think about porting it later. I also write tests in Python which is very efficient (in lines of code). Having those tests available makes the porting considerably easier as you can verify the new code quickly.