Create an IPython launcher on OS X

This is just a quick how-to on creating a launcher for the IPython Qt console on Mac OS X.

  1. Open up AppleScript Editor and enter the following:
    do shell script "cd ~; /usr/local/bin/ipython qtconsole --pylab"

    Check that the path to ipython is correct for you by running which ipython from the terminal. You can also change the starting directory if you wish.

  2. Save the script with the name IPython and file format Application in /Applications/IPython App
  3. You should now be able start an IPython Qt console from Spotlight or Launchpad, just like any other app. But you’ll notice two things: the Launchpad icon is the AppleScript icon, and after launch you’ll have both IPython and AppleScript icons in your dock. Let’s fix that.
  4. The icon for the IPython Qt console resides in your Python distribution’s site-packages at IPython/qt/console/resources/icon/IPythonConsole.svg. We’ll need to convert it to an .icns file. I used iConvert Online to do this, and I’ve made the result available here
  5. Replace /Applications/IPython.app/Contents/Resources/applet.icns with the .icns file from the previous step.
  6. Edit /Applications/IPython.app/Contents/Info.plist and add the following lines after the first <dict>
    <key>LSBackgroundOnly</key>
    <string>1</string>
    

That’s all. The only drawback to this method is that it doesn’t allow you to pin IPython to the dock and launch it from there, if anyone figures out how this can be done please let me know.

2 thoughts on “Create an IPython launcher on OS X

Leave a Reply

Your email address will not be published.