Introduction to Python Workshop

Before the Workshop

To make sure we hit the ground running in the workshop, we need you to perform a few steps before the day of the workshop. More specifically, we need to make sure you already have access to a Python interpreter, either on a CS machine or on your own laptop.

Option 1: Using a CS Linux Login Server

You will be able to run through all the examples and exercises of the workshop simply by logging into one of the CS Linux login servers from your laptop. To do this, you must check the following before the workshop:

  1. Can you connect to the UChicago wireless network?
    If you are an alum, make sure you've claimed your Alumni CNetID. Otherwise, you will be unable to get on the wireless network.
  2. Install an SSH client on your laptop
    If you are using a Mac or a Linux laptop, SSH is already installed on your laptop. To test that SSH is correctly installed, open a Terminal and enter the following command:
    ssh -V
    You should see something similar to this:
    OpenSSH_5.9p1, OpenSSL 1.0.1 14 Mar 2012
    If you are using a Windows laptop, you will need to install an SSH client. We recommend using PuTTY.
  3. Verify you can SSH into a CS UNIX machine

    If you are using Mac or Linux, run SSH like this from the terminal:

    ssh username@linux.cs.uchicago.edu

    Substituting username for your CNetID. When asked for a password, enter your CNetID password.

    If you are using Windows, use the following connection information:

    • Username: Your CNetID username
    • Password: Your CNetID password
    • Hostname/Server: linux.cs.uchicago.edu

    Do not change any other connection parameters.

    If your connection is successful, you should see the following prompt:

    username@linux1:~$ 

    or:

    username@linux2:~$ 

    If you are unable to connect to the CS Linux login server, you may need to request a CS account (this will be the case if you've never taken a Computer Science class). You can request a CS account here.

  4. Option 2: Installing Python on your Laptop

    You can also follow the workshop examples and exercises by installing Python on your laptop. However, please make sure you read the Prerequisites page: we specifically assume that you know how to use the command-line interface in your operating system. Also, please note that the instructor and TAs have little to no experience with Windows systems, and may not be able to assist you if you are using a Windows laptop. In that case, it is preferable that you SSH to a CS Linux login server, as describe above.

    Please note that we will be using Python 2.7, not Python 3, in this workshop.

    If you install Python on your laptop, you must verify that you can run the Python interpreter on your laptop before the workshop. If you can ultimately run a python command from your system's command-line interface, and see something similar to this:

    Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 

    That means that you are all set.

    Mac OS X

    • If you have Mac OS X 10.6 or above, you already have Python installed by default. To confirm that you have Python installed, simply start a terminal (Applications->Terminal) and type 'python'. That should start the Python interpreter. If, instead, you get an error message stating that the command was not found, you need to install Python.
    • To install Python, please see the instructions provided on the official Python documentation.

    Linux

    • Python is usually installed by default on most Linux distros. If you cannot run python from a terminal, you will need to use your system's package manager to install Python (the exact mechanism will vary from distribution to distribution).

    Windows

    • To install Python on Windows, please see the instructions provided on the official Python documentation. Make sure that you set up the environment variables as described in those instructions. You should verify that you are ultimately able to run the python command from the Windows Command Prompt

    IPython

    • Optionally, you should also install the IPython shell. Their page provides detailed installation instructions. Please note that, if you are unable to install IPython, you will still be able to follow the examples and exercises in the workshop. IPython provides some tools that you may find useful, but which are not strictly required for this workshop.

    Trouble?

    • If you encounter any issues, we encourage you to register for the afternoon session (2pm-6pm). TAs will be available from 1pm to 2pm to assist attendees in getting set up. Unfortunately, we cannot provide this service before the morning session (9am-1pm).