I recently bought a MacBook and install Python on it via Anaconda. Here's the version information:
Python 2.7.6 |Anaconda 1.8.0 (x86_64)| (default, Nov 11 2013, 10:49:09)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
I'd like to be able do all of the following:
Here's what I've tried:
Here's what I can do:
Once I have this working, I'm interested in doing the following:
A. Controlling which scripts create a console window when they run and which do not
B. Controlling whether the resulting console window disappears when the script completes or waits around for the user (me) to close it
However, I suspect it may be easy to figure out how to do these (or whether it's possible) once I've figured out how I'm going to invoke my scripts in the first place.
To make spyder callable from Spotlight or Finder:
Locate where your spyder executable is by running in Terminal:
which spyder
This should yield ~/anaconda/bin/spyder
if you installed spyder via Anaconda, /opt/local/bin/spyder
if you used MacPorts or something similar.
Create a file called spyder
in your Applications
directory and make it executable. Then, fill it with the output of the previous command, followed by a &; exit
:
touch /Applications/spyder
chmod +x /Applications/spyder
echo -e '#!/bin/bash'"\n~/anaconda/bin/spyder &\nexit" >> /Applications/spyder
(if you use a different shell (e.g. tcsh
), replace bash
by that)
Under Terminal -> Preferences -> Profiles -> "default profile" -> Shell -> When the shell exits: Select "Close if the shell exited cleanly"
Optional:
Download the spyder Icon from here and open it in Preview. Copy its contents by hitting cmd+C.
In Finder, locate /Applications/spyder
and open its "Get Info" pane by hitting cmd+I. Select the icon in the top left corner with your mouse and hit cmd+V.