CS 151 Fall 2019     Syllabus     [Resources]     Labs/Projects

Installation Course Resources Python Resources

Installation

Installing Python 3 (Windows)

The following steps assume you're using Windows 10 and Microsoft VS Code, the text editor that we use in class. Please email the CS Dept. Windows Support Miguel Rebollar to troubleshoot problems.
  1. Download and install Microsoft VS Code.
  2. Install the Python extension if you'd like syntax coloring.
  3. Download Python 3.7 and run the installer.
  4. Make sure the last checkbox is checked: "Add Python 3.7 to PATH".
  5. Click "Install Now" at the top.
  6. Press WinKey+R to open the Run box.
  7. Type cmd and enter.
  8. Type python --version and it should print Python 3.7.0. If it doesn't, something went wrong.
  9. Open Microsoft VS Code.
  10. Open the python file you'd like to run.
  11. On the bottom left corner of the Microsoft VS Code editor window, if you see "Select Python Environment", click it and select Python 3.7 that you installed. If you do not see "Select Python Environment", follow the instructions here. After this step, you should see "Python 3.7.0" on the lower-left corner of the VS Code editor window.
  12. Press control+` to open the built-in terminal.
  13. Navigate in the terminal to the python (.py) file that you'd like to run (e.g. using cd).
  14. Run your python code with python my_python_file.py.

Installing Python 3 (macOS)

  1. Open the terminal app.
  2. Install Xcode Command Line Tools by entering the following command: xcode-select --install.
  3. Install the Homebrew package manager by copy-pasting the following into the terminal
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)".
    This allows you to install Python 3 from the terminal.
  4. Install Python 3 by entering the following into the terminal: brew install python3
  5. Check to see if Python 3 installed properly by entering the following into the terminal: python3 --version.
    It should return Python 3.7.0.
  6. Change the directory/path in terminal to the folder that contains the python file you'd like to run (e.g. by entering cd (Drag folder icon into terminal)).
  7. Enter into the terminal python3 my_file.py to run your code.

Course Resources

Past lecture notes

The following materials are very helpful, but please note that they were written for Python 2. While they are still great learning tools, some pieces -- e.g. print statements -- will not execute correctly in Python 3.

Bruce's Lecture Notes

Past quizzes

The following materials are very helpful, but please note that they were written for Python 2. While they are still great learning tools, some pieces -- e.g. print statements -- will not execute correctly in Python 3.

Lord of the rings quizzes

Harry Potter quizzes

Star Wars quizzes

Python Resources

Python Websites

  • Python.org -- This is the main source for all documentation on Python. his documentation can be downloaded to your computer so that you don't need web access to view it. Note that we will be using Python 3.7 in lectures and labs.

Free Online Books on Python

Links to free online Python help

Links to free Python development environments

© 2018. Page last modified: .