Python Essentials


Python on Windows and Mac

You can download a recent version of Python from http://python.org/downloads/. The website should recognize your operating system, if not, you can navigate to the version for your desired operating system using the "Downloads" tab. I recommend to choose the most recent stable version of Python (e.g., 3.6.4 as of March 2018), but definitely do NOT install anything that starts with "2.".

Python on the Web

There may be several options to run Python code in a web browser, but the recommended tool for this course is Jupyter Notebook. Follow the instructions on that page to install Jupyter using Anaconda (recommended) or pip. In a terminal/shell, you can start Jupyter by typing jupyter notebook. This Jupyter documentation is a good starting point to learn how to use it to program in Python. Scroll to the part where it says "How To Use Jupyter Notebooks". Hint: If you receive errors when running your code, but you are certain that all mistakes have been fixed, click the "Restart the kernel" button and try again.

First Python Examples

If you are new at Python programming, there are countless tutorials on the web that can get you started. For example, https://pythonspot.com/ has a nice list of brief examples demonstrating the key features of Python. I recommend going through at least the Beginner section; you can copy code fragments directly into your Jupyter Notebook and test it there (note: if a print command results in an error, try adding () around the text to be printed).