Determining my most used focal length in photos with python and dcraw
For the holidays I got a new Canon 7D camera. I’ve been saving quite a few amazon gift cards over the last year that I was previously planning on using towards purchasing the camera but thankfully Santa delivered me one. My current lens collection consists of
- 10-22mm f/3.5-4.5
- 70-200mm f/4
- 50mm f/1.8
- 18-55mm f/3.5-5.6 (kit lens) The lens collection has been built over the last 4 years from when I first got my Canon Rebel XT and I’ve been fairly happy with them thus far. As part of looking into what new lens to get I wanted to know what focal length I shot with the most over the previous years. A quick look with
find . -type f -name '*.CR2' | wc -l
shows I have 4697 RAW images in my photos folder, so I’ll need some sort of automated solution to figure this out.
Python pip on Ubuntu Lucid Lynx
Lately I’ve been reading up on Django a bit in an effort to get back into programming. It seems the preferred way of running Django is inside a virtualenv environment. I try to stick to packages when possible for installing applications and saw that the python-virtualenv package wasn’t too far behind at version 1.4.5, where the latest is at 1.5.1. This appeared at first to suit me just fine until I discovered the version of pip that gets installed along with python-virtualenv is at 0.3.1, where the latest is at 0.8.1. The version of pip installed is so old that it doesn’t have support for the “uninstall” command yet, blech. Luckily you can do the following from within pip to upgrade itself
Python Quote module
Over the past couple of years I’ve been wanting to learn Python more seriously but really haven’t sat down and just done it. I’ve written a couple of various scripts for personal and work use but always felt they weren’t coded in a “pythonic” way. I’m now reading Learning Python (4th edition) from the beginning and making sure I learn things properly from the ground up. When I was writing my code in the past I wasn’t aware of what objects were immutable vs mutable or how generators worked. I basically knew what I wanted to accomplish before writing my code and would reference the online documentation and just go at it. Overtime I picked up on some “pythonic” methods from looking at code examples, for example, using optparse for handling arguments passed into your program.