Linguist 278: Programming for Linguists — Resources

Instructional materials

Python 3 and Anaconda

We recommend installing the free Anaconda Python distribution, which includes IPython, Numpy, Scipy, matplotlib, scikit-learn, NLTK, and many other useful packages. This is not required, but it's an easy way to get all these packages installed. Unless you're very comfortable with Python package management and like installing things, this is the option for you!

Please be sure that you download the Python 3 version, which currently installs Python 3.8. (Python 3 is not compatible with Python 2; this course will be exclusively in Python 3.)

Terminal (shell)

Mac users

  1. Launch Terminal.app, which is installed in Applications/Utilities.
  2. Move to the directory you want to work in by typing cd (with a final space) and then dragging the desired folder into the terminal window. That will enter its path, and then you just hit enter. (This can also be done while inside the Python shell, that is, after the next step.)
  3. Type ipython and hit enter. Now you're in the interactive shell.
  4. Hit Control-D to exit.

Windows users

  1. Find Anaconda Prompt via the Start menu.
  2. In the window, type ipython and hit enter.
  3. Type ipython and hit enter. Now you're in the interactive shell.
  4. Move to the directory you want to work in by typing cd (with a final space) and then dragging the desired folder into the terminal window. That will enter its path, and then you just hit enter.
  5. Hit CTRL-Z to exit.

A course virtual environment

One you have Anaconda installed, it makes sense to create a virtual environment for the course. In a terminal, run

conda create -n pfl python=3.8 anaconda

to create an environment called pfl.

Then, to enter the environment, run

conda activate pfl

To leave it, you can just close the window, or run

conda deactivate

This page has more detailed instructions on managing virtual environments with Anaconda.

Text editors

A text editor is a program that allows you to type and save plain text (sequences of characters). Programs like MS Word, TextEdit or Notepad are not text editors, because they encode their files in special formats, which allow them to record styles and formatting.

If you don't already have a text editor you like, then I urge you to use Atom and install its script package so that you can run Python modules directly from its text editor window.

Here are a few other options, but I suggest choosing one of these only if you have independent and compelling reasons to do so. I myself can help with Atom, but I am not sure about the others.