Brian Ray's Blog

Painting is just another way of keeping a diary. --Picasso

Thu, 27 Oct 2005

IPython as primary Shell

IPython , a Python interactive shell developed for the scientific computing community by Fernando Perez is such a powerful tool, I just may replace my default login settings from just bash [1] directly to IPython over bash.

How may people do this? I mean really! Is it practical to cross this line?

If you are new to IPython, there is a decent intro article from ONLamp. Although, I fail to see how this article fits into the LAMP [2] world. Still, it unveils some need features like:

  • magic: Quickly assess special IPython features.
  • Tab Completion: auto-complete code attributes, classnames, methods, and more
  • Introspection: Easy access to Doc Strings and internal documentation
  • History: store a dumpable session of commands
  • Debugger Access: internal access to pdb
  • Run: a safe way to run a file and ignore the __name__ == "__main__", trick
  • Macros: capture command history into a macro

All great stuff. Also mentioned in the article is System Shell Access. For example, you can use cd, pwd, and ls directly in IPython. To escape to the shell use '!' or '!!'.

The IPython Manual notes in the section IPython as system shell. I loose job control if I use iPython this way. Although, I haven't had many issues so far.

Starting IPython with "ipython -p pysh", creates a special enviroment just for shell usages. Usefull in assinging aliases, moving around, and esp capturing varialbes:

bray@chipy[~]|1> $logs = ls *.log
bray@chipy[~]|2> logs.split("\n")
             <2> ['labtest.log', 'try.log', 'untitled-1.log']

In addition, with "ipython -pylab", I can do interactive plots with a fellow ChiPy member's matplotlib. I blogged more about matplotlib. For OSX users, from another ChiPy fixture, Here is some advice on getting matplotlib running.

As ludicrous as it seems, I am unable to find reasonable reasons why not to use IPython as my primary shell.

[1]Bourne Shell (/bin/sh) predecessor, for Bourne Again SHell. :D
[2]LAMP stands for Linux, Apache, MySQL, and [Perl, PHP, or Python] -- a web framework.

Sun, 23 Oct 2005

Apples Aperture SDK

Will the champions of the digital photography world accept Apples new Aperture software without a SDK/API?

Aperture is iPhoto on steroids with a super steep $499 sticker. Competition for Adobe Photoshop? Probably not. However Aperture touts lossless RAW and some seriously cool apple'esk workflow options. But with no DNG or SDK/API Aperture still is no Photoshop.

It is good Aperture aims to gap the lossless image editing gap. This needs done. But as a developer, I imagine the finicky Pro Photography Apple crowd will not be happy to hear there is no way to add features, integrate with specialized devices, or integrate with a larger production workflow.

If Jobs thinks Aperture investment in R&D will help compete with Adobe's Macromedia line and Adobe's highly customizable line of products, he may be missing the mark by not appealing to the large pool of third party developers. Or maybe getting access to the API is only for the privileged, say Motorola in the case of their Rockr phone's use of ITunes.

To me, good R&D requires allowing integration across a broad range of products. For this, a good, open, and solid SDK/API is proof this diligence has been done.