Installing Python and Sublime Text 2
on a Windows 7 or Mac OS X Computer
Python 2.7.x,
the development language for this course, may already be installed in some form
on your laptop. Likewise, you may already have Sublime Text 2. The instructions
here are general guidelines for getting the packages onto your Windows PC or Mac
OS X computer. You can also set both environments up for Linux but since I don�t
have a Linux machine right now, you will have to work that out on your own.
Installing Python
On a Windows PC:
First, check
to see if you already have Python. Open up a command window. On Windows 7,
click the Start button and type cmd in the text
box (for other versions of Windows, google �open command prompt windows X�). A
window with a command prompt will open. In the command prompt window, type python. If you get a message saying that Python is not recognized,
then you will need to install it on your computer. If Python does start, check
the version. If it is 3.x, you will still need to download version 2.7.x. Also,
make sure that �Anaconda� is mentioned somewhere in the starting info. If it is
not, you should continue with the installation instructions. Type quit() at the >>>> prompt and Python will exit.
If you do
not have version 2.7.x of Python, click
here to get the Python Anaconda distribution. Anaconda includes a Python
interpreter and many other helpful tools for Python programming. Click the Python 2.7 Windows 64-bit graphical
installer and follow the instructions.
On a Mac (OS X):
First, check
to see if you already have Python. Open up Terminal. The easiest way is to open
Spotlight with ⌘+space and type terminal in the text field. Double click on
Terminal under applications. In Terminal, type python. If you get a message saying that Python
is not recognized, then you will need to install it on your computer. If Python
does start, check the version. If it is 3.x, you will still need to download
version 2.7.x. Also, make sure that �Anaconda� is mentioned somewhere in the
starting info. If it is not, you should continue with the installation
instructions. Type quit() at the >>>> prompt and Python will exit.
If you do
not have version 2.7.x of Python, click
here to get the Python Anaconda distribution. Anaconda includes a Python
interpreter and many other helpful tools for Python programming. Click the Python 2.7 Mac OS X 64-bit graphical
installer and follow the instructions.
Installing Sublime Text 2
Sublime Text
2 is available for both Windows PCs and Macs running OS X. Click here to get
Windows and OS X installers.
Testing your installation
Start
Sublime Text 2. Enter
print �hello python�
in the text
window.
Save the
file somewhere with a name like HelloPython.py
It is very important to save the file with a .py
extension before the next step.
On Windows,
type ctrl-B. On the Mac, type ⌘+B
In both
cases, your program should run and hello
python should be
printed at the bottom of the frame. You can exit Sublime�all is well. If
nothing happened, make sure to save your file with a .py extension and try again.